Exceptions in Query

  • Thread starter Thread starter Gonzalo
  • Start date Start date
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
 
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:
 
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
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top