I want to create a report that evaulates data collected from Sunday of the current week. If I call whatever date Sunday is StartWeek, I need to select data between StartWeek and currentdate.
I tried the following formula with no success:
shared dateVar sdate := currentdate;
if weekday(currentdate) = 2 then sdate = (currentdate - 1) else
if weekday(currentdate) = 3 then sdate = (currentdate - 2) else
if weekday(currentdate) = 4 then sdate = (currentdate - 3) else
if weekday(currentdate) = 5 then sdate = (currentdate - 4) else
if weekday(currentdate) = 6 then sdate = (currentdate - 5) else
if weekday(currentdate) = 7 then sdate = (currentdate - 6)
I'm sure there is a much better formula that actually works..... I am using Crystal Reports 8.5.
I tried the following formula with no success:
shared dateVar sdate := currentdate;
if weekday(currentdate) = 2 then sdate = (currentdate - 1) else
if weekday(currentdate) = 3 then sdate = (currentdate - 2) else
if weekday(currentdate) = 4 then sdate = (currentdate - 3) else
if weekday(currentdate) = 5 then sdate = (currentdate - 4) else
if weekday(currentdate) = 6 then sdate = (currentdate - 5) else
if weekday(currentdate) = 7 then sdate = (currentdate - 6)
I'm sure there is a much better formula that actually works..... I am using Crystal Reports 8.5.