G
Guest
Hello -
I have a query that sets criteria on a DATE field to pull data from the
previous day (if yesterday is not equal to sunday), and if yesterday is equal
to sunday, then it will pull data from friday - sunday.
This is the code I am using:
IIf(Weekday((Date()-1))=1,Between (Date()-3) And Date()-1,Between Date()-1
And Date()-1)
When I run the query with this code, it pulls no records. I've checked
everything that I can think of. By itself, Between (Date()-3) And Date()-1
works fine. I know the Weekday(Date()-1) = 1 for Sunday, since I have used
this code elsewhere.
Something about the IIF statement is messing this up, but I'm not sure what
it is or how to fix it...
Thanks for your help,
Nick
I have a query that sets criteria on a DATE field to pull data from the
previous day (if yesterday is not equal to sunday), and if yesterday is equal
to sunday, then it will pull data from friday - sunday.
This is the code I am using:
IIf(Weekday((Date()-1))=1,Between (Date()-3) And Date()-1,Between Date()-1
And Date()-1)
When I run the query with this code, it pulls no records. I've checked
everything that I can think of. By itself, Between (Date()-3) And Date()-1
works fine. I know the Weekday(Date()-1) = 1 for Sunday, since I have used
this code elsewhere.
Something about the IIF statement is messing this up, but I'm not sure what
it is or how to fix it...
Thanks for your help,
Nick