Dear HFTHdfries,
Without any parameters entering into the picture here is a select formula that passes the sql and will select back to the monday of the week the year starts in regardless of the year. So the formula selects current year data + whatever days necessary of last year to get the first full week.
Of course the ending should also be adjusted so that it ends on a Sunday...but lets start here:
//begin
({Table.Datefield} in
Switch
(dayofweek(date(Year(currentdate),01,01)) <> 2,
((dateadd("d",-(dayofweek(date(year(currentdate),01,01))),(date(year(currentdate),01,01)))+2)
to
Date(Year(currentdate),12,31)),
(dayofweek(date(Year(currentdate),01,01)) = 2), Date(Year(currentdate),01,01) to Date(Year(currentdate),12,31)))
//end
This formula when used now returns data from 12/30/2002 to 12/31/2003.
I was actually writing this when you made your latest post so, now I am trying to understand your latest post, what gets put into the parameters that the users are populating? Are these dates or week numbers?
ro Rosemary Lieberman
rosemary@microflo.com,
Microflo provides expert consulting on MagicTSD and Crystal Reports.