Weekday Only

mlr0911

Registered User.
Local time
Today, 03:23
Joined
Oct 27, 2006
Messages
155
I have a query that when the day falls on a Monday, I need the query to look at the date for the previous Friday (Example; if I ran my query yesterday on 10/20/08; the date the query would search on would be 10/17/08). I also will have to run the query for the previous day (Example; if I run my query today 10/21/2008; the date the query would search on would be 10/20/08).

I was thinking that I should use the IIF function and datediff, but I can get them to work properly:
Code:
iif(datediff("w",now()-2,now())

Thank you for your time.
 
I have a query that when the day falls on a Monday, I need the query to look at the date for the previous Friday (Example; if I ran my query yesterday on 10/20/08; the date the query would search on would be 10/17/08). I also will have to run the query for the previous day (Example; if I run my query today 10/21/2008; the date the query would search on would be 10/20/08).

I was thinking that I should use the IIF function and datediff, but I can get them to work properly:
Code:
iif(datediff("w",now()-2,now())

Thank you for your time.

Access has a WeekDay() Function and there have been numerous posts in this forum related to the subject. If you start looking by searching for the phrase Weekday(, you can find a lot of them, including the example below:

http://www.access-programmers.co.uk/forums/showthread.php?t=154724&highlight=weekday(
 

Users who are viewing this thread

Back
Top Bottom