[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Weekdays only in where clause

Posted on 2009-02-20
2
Medium Priority
?
257 Views
Last Modified: 2012-05-06
If I have the following where clause in an ms access 2003 query

WHERE (ConnectedDate Between #2/1/2008# And #1/31/2009#)

Is there a way to change it so that only dates that are in that range that are weekdays are returned?
0
Comment
Question by:johnnyg123
2 Comments
 
LVL 93

Accepted Solution

by:
Patrick Matthews earned 2000 total points
ID: 23697199
WHERE (ConnectedDate Between #2/1/2008# And #1/31/2009#) And Weekday(ConnectedDate, 2) < 6
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 23697281
yes:

WHERE (ConnectedDate Between #2/1/2008# And #1/31/2009#)
 AND DatePart("w", ConnectedDate) not in (1,7)

Open in new window

0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What we learned in Webroot's webinar on multi-vector protection.
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question