Query using text boxes for dates

G

Guest

Hello All,

I'm using a form to filter for several items using combo boxes which all
work. However I need to sort the records if the user chooses by a date range.
This can be done if I ask the user for the dates via parameter value boxes
listed in the criteria using the between..and etc, however to do that I have
to prompt the user each time and a date range may not be needed or wanted for
every search.

How do I go about calling dates from text boxes located the form using a
query so that it 1. recognizes the text as a date and filters the range and
2. if nothing is entered in the text boxes how do I get the query to return
all values.

Thanks a bunch
 
A

Allen Browne

See:
Limiting a Report to a Date Range
at:
http://allenbrowne.com/casu-08.html

The 2nd method in the article explains how to use a form with 2 dates like
this:
- user enters both dates: return values between them (both inclusive);
- user enters start date only: return values from that date onwards;
- user enters end date only: return values up to and including that date;
- user enters neither: return all.
 

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