Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report on last full 2 weeks in a period

Status
Not open for further replies.

goldyr

Programmer
May 26, 2003
25
SE
I want to create a formula that gives me all records from the last period of 2 weeks. (The year has 26 periods starting with week 1)
I have found the formula LastFullWeek but how can I get 2 weeks in right period? Period 1: w1 + w2 Period 2: w3 + w4 and so on...
I also whant the report to present the periods last date (ends on saturday).
 
Just leverage the lastfullweek using something like:

{Orders.Order Date} >= minimum(lastfullweek)- 7
and
{Orders.Order Date} <= maximum(lastfullweek)

-k
 
Thanks, but in what format is the date in?
My date comes as numeric 20030526 from the database and I have converted it in the report but it doesn´t work in the formula.
 
No worries, I did it based on a real date field.

Try converting the dates, as in:

{table.field} > =val(totext(minimum(lastfullweek),&quot;yyyyMMdd&quot;))
and
{table.field} <= val(totext(maximum(lastfullweek),&quot;yyyyMMdd&quot;))

This should generate the proper SQL to pass to the database too.

To display the highest date, right click the date field and select insert summary->Maximum

Hope this resolves.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top