Date or Range of Dates

  • Thread starter Thread starter Betsy
  • Start date Start date
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!
 
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.
 
Back
Top