Date or Range of Dates

B

Betsy

how can I have a query that will allow a user to enter
either a specific date or a range of dates?

Field is ship date.

Thanks in advance!
 
J

John Vinson

how can I have a query that will allow a user to enter
either a specific date or a range of dates?

Put a criterion of

([Shipdate] >= CDate([Enter start date:]) OR [Enter start date:] IS
NULL)
AND
([Shipdate] < DateAdd("d", 1, CDate([Enter end date:])) OR [Enter end
date:] IS NULL)

If they enter dates (the same date for specific date) in both prompts,
it will find all shipdates in between; if they enter only a start date
it will find from that date on; if they enter only an end date it will
find all earlier dates.
 

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