Limiting Query Results (to only certain days of the week)

F

FedBrad

Hi All,

I have a table that contains a record for each date, through several years
into the future. On a form, I want to use a combo box to select a date to
save in a field in records (in a different table, of course). And, want the
combo box for selecting the date to only provide a certain day of the week
(i.e., only display Sundays as dates to choose from).

The reference table includes two date fields - one in short date format and
one in long date format (not sure why I did that at the time...?).

Ihave searched through several different threads today, even using only the
keyword "dates," with no luck. Any help in crafting a query/filter for this
combo box would be greatly appreciated.
 
J

John Spencer

The source for the combobox should be something like

SELECT YourDateField
FROM YourTable
WHERE WeekDay(YourDateField) = 1

1 = Sunday
7 = Saturday (work out the others for yourself.



'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 

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