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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

previous days data...unless its monday

Status
Not open for further replies.

Bloke152

Programmer
Aug 9, 2005
123
NO
Hi Guys, im running CR9.

Im trying to get the prvious days data unless its monday, then I want to return Fridays, Saturdays and Sundys data.

I have the following in my record selection but the report is still returning wrong data.

{wmTransaction.TransactionDate} < currentdate
and {wmTransaction.TransactionDate} >
(if dayofweek({wmTransaction.TransactionDate}, 1) = 2 then
currentdate - 4
else currentdate - 2)

Since there is currently only a small amount of test data in the table, im not sure if its all data or the wrong days data its returning but it does appear to be returning everything as I have tried changed the day numbers etc.

I know nothing should be returned today but I am getting data dated the 11th.
 
dont worry guys. Sorted cheers, just needed a coffee!
 
Please always share your solution so that others can benefit from your threads.

-LB
 
Sorry,
It was one of those things you stare at for ages and never notice your own obvious mistake.

In the original code I posted I was picking up the day of the week of the data date, when I should have been looking at the day of the week of currentdate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top