date range

G

Guest

I am currently running a query that pulls out data based on a date range. I
have been asked to automate this process. I'm not sure how to handle my date
range. I export the query on Tuesday for the previous Fri., Sat., Sun., and
Mon. I send the query again on Friday for the range Tue., Wed., and Thurs.

Any ideas on how to set this up to automatically figure the date ranges
based on the days of the week?
 
G

Guest

You probably shoud use two queries in case you do it late.

This will give you FRI, SAT, & SUN even if done on MON, TUES, WED, or THRU.
Between (Date()-Weekday(Date()))-1 And (Date()-Weekday(Date()))+1

This will give you TUES, WED, &THRU even if done on FRI, SAT, or SUN.
Between (Date()-Weekday(Date()))-4 And (Date()-Weekday(Date()))-2
 

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

Top