Weekend and holiday dates only

D

Douglas J. Steele

For holidays, your only real choice is to have a table of holiday dates, and
join that to your existing table.

For weekends, you could use WHERE Weekday(MyDateField) IN (1, 7)
 
C

CMM

Is the MyDateField where I put a to and from date? For example, I want to run
the query from 11/01/07 through 11/30/07. Also, do I extend the IN (1,7) to
IN (1,7,8,14,15,21,22,29)? An example would be great if available. Thank you
again!
 
D

Douglas J. Steele

MyDateField would be the name of the date field in your table.

Weekday returns number 1 through 7 for Sunday through Saturday respectively.

You'd want

WHERE Weekday(MyDateField) IN (1, 7)
AND MyDateField BETWEEN #11/01/2007# AND #11/30/2007#
 

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

Similar Threads

difference in dates 0
WORKDAY and holidays 7
Can't query DateDiff 3
Show dates 1
Parameter Query 8
Net Work Days in Access? 1
Need to account for weekends on some SQL 2
Is this Possible? - Working Days 4

Top