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

excluding saturday/sunday from daily report 1

Status
Not open for further replies.

timbaktuu

Programmer
Jan 19, 2011
23
US
Hello all,

I have a daily report, that has following selection formula in
record select:

{table.Timestamp}= currentdate -1 and
{table.Timestamp} in datetime(currentdate-1,time(9,0,0)) to datetime(currentdate-1,time(20,0,0))

If I run it on monday 2/14/2011 how can i default it back to Friday 2/111/2011 for interval 9 to 8 instead of going back to sunday. I tried weekdayname()<>....but it did not work.

Thanks for your help.
 
Try

If dayofweek(currentdate) <> 2 then
{table.Timestamp}= currentdate -1 and {table.Timestamp} in datetime(currentdate-1,time(9,0,0)) to datetime(currentdate-1,time(20,0,0))
else

{table.Timestamp}= currentdate -3 and {table.Timestamp} in datetime(currentdate-3,time(9,0,0)) to datetime(currentdate-3,time(20,0,0))
 
Just a comment that the first line of the formula is unnecessary in that you are already limiting the records to a specific date in the second line of the formula.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top