Exceptions in Query

G

Gonzalo

I placed this statement in a query to get all data starting from Sunday thru
Saturday, but when I run the query on Mondays I want the query to give me
data from Sunday thru Saturday, this is an exception on for Mondays
 
M

Marshall Barton

Gonzalo said:
I placed this statement in a query to get all data starting from Sunday thru
Saturday, but when I run the query on Mondays I want the query to give me
data from Sunday thru Saturday, this is an exception on for Mondays


You might want to rephrase your question ;-)

Just guessing now, but maybe you want:
 
G

Gonzalo

Rephrase question, I run reports 5 days a week starting Monday and ending on
saturday, when I run the query for the report I want it to give me the
results for week to date, Except on Mondays since I enter the date for
Saturday on Monday, when I run the report on Monday I want the week to date
for the previous week, Tuesday thru saturday I want it week to date.

Gonzalo
 
M

Marshall Barton

Gonzalo said:
Rephrase question, I run reports 5 days a week starting Monday and ending on
saturday, when I run the query for the report I want it to give me the
results for week to date, Except on Mondays since I enter the date for
Saturday on Monday, when I run the report on Monday I want the week to date
for the previous week, Tuesday thru saturday I want it week to date.

=Date()-Weekday(Date())+1+7*(WeekDay(Date())=2) And <IIf(Weekday(Date())=2, Date()-1, Date()+1)
 
Top