Query specific days of the week details from date entries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In an Access 2002 database, I am tracking daily sales. Using the dates, I
want to obtain results for sales that fall on certain days of the week. Ie.
All Fridays and Saturdays, Year to Date.

The field is formatted as General Date with an input mask that reflects
mm/dd/yyyy.

I've run into this barrier many times without any success.
 
WHERE Weekday(MyDateField) IN (6, 7)

Replace "MyDateField" with the actual name of the field.
 
Thanks for that. Is the (6, 7) the prompt for the day of week (6 being Friday
and 7 being Saturday)?
 
Yes. Weekday returns 0 for Sunday, 1 for Monday and so on to 7 for Saturday.
In VBA, you can refer to the day values using the intrinsic constants
vbSunday, vbMonday, ... vbSaturday. Unfortunately, you can't use those
constants in a query.
 

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

Back
Top