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

DateAdd Include Last 3 Days 1

Status
Not open for further replies.

cwsstins

MIS
Aug 10, 2004
412
US
CR8.5
If today <> Monday, I need data from yesterday
If today = Monday, I need data from the last 3 days (Sunday, Saturday, Friday).

I'm using a dateadd as such:
Code:
if dayofweek(CurrentDate) = crTuesday
    then DateAdd("d", -1, Date(year(CurrentDate),month(CurrentDate),day(CurrentDate)))
    else

...for each day other than Monday. How can I set Monday's statement to include the last 3 days?

 
Try this

Code:
if dayofweek(currentdate) = 2 then
  {table.date} in currentdate-3 to currentdate - 1
else
  {table.date} = currentdate - 1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top