Calculate "week-ending" date

G

Guest

In an Access query, I'd like to have an expression that takes the current day
of the week (Sun through Sat) and returns the date for Saturday (in "Short
Date" format) of that same week. Please advise.
 
J

Jeff Boyce

One way to approach this would be to get the day number (Sunday = 1, Monday
= 2, ...) of the current date (Date()), subtract that from 7 (days in a
week), then add that many days to the current date (using DateAdd()
function).

Or have I misunderstood?
 
G

Guest

Thanks so much for the tip...it worked great!!!
--
Thanks!
Mona-ABE


John Ortt said:
Try something allong the lines of:

DateAdd("d",(7-Weekday([DATE])),[DATE])
 
G

Guest

Thanks so much for the tip...it worked great!!!
--
Thanks!
Mona-ABE


Jeff Boyce said:
One way to approach this would be to get the day number (Sunday = 1, Monday
= 2, ...) of the current date (Date()), subtract that from 7 (days in a
week), then add that many days to the current date (using DateAdd()
function).

Or have I misunderstood?
 

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