markedback
MIS
I am running a select query on a table where the date range is 3 days if the current day is Monday and date range is 1 day if the current day is any day other than Monday
The purpose of this query is to view records added on the previous day. On Monday, it views the records added on Friday, Saturday and Sunday.
I need to do this as this is a repetitive daily task.
I am using this syntax:
Between IIf(Weekday(Date())=2,Date()-3,Date()-1) And Date()-1
The query runs fine.
But sometimes it leaves out records which are captured when I use - Between #MM/DD/YYYY# And #MM/DD/YYYY 11:59:59 PM#.
Could someone please suggest a way to incorporate the time component in the above syntax (Between IIf(Weekday(Date())=2,Date()-3,Date()-1) And Date()-1)?
Thanks in Advance!
The purpose of this query is to view records added on the previous day. On Monday, it views the records added on Friday, Saturday and Sunday.
I need to do this as this is a repetitive daily task.
I am using this syntax:
Between IIf(Weekday(Date())=2,Date()-3,Date()-1) And Date()-1
The query runs fine.
But sometimes it leaves out records which are captured when I use - Between #MM/DD/YYYY# And #MM/DD/YYYY 11:59:59 PM#.
Could someone please suggest a way to incorporate the time component in the above syntax (Between IIf(Weekday(Date())=2,Date()-3,Date()-1) And Date()-1)?
Thanks in Advance!