Searching for records by a date defined by the user

andy101

New member
Local time
Today, 08:29
Joined
Mar 3, 2001
Messages
7
Hi, I need to build a query where all the records are found between two dates which the user enters, Please Help!
 
Hi Andy101

This is a fairly basic area of database design. Have you tried looking in the Help File, in the sample databases provided with Access or in any decent Access Book (Developer's Handbook, Bible, Running Access, etc).

You really need to "get your hands dirty" and have a go! If you find you can't do it, explain what you have tried to date (no pun intended) and what's going wrong. Then I am sure there will be lots of people prepared to offer advice!

Good luck


Rich Gorvin

[This message has been edited by Rich@ITTC (edited 03-23-2001).]
 
On the criteria line of the date column:

Between [Enter start date mm/dd/yyyy] and [Enter end date mm/dd/yyyy]

When the query runs, it will prompt for the two dates.
 
What if the dates entered in the text box don't exist?
i.e. 29th Feb 2001 does not exist.
how do you check to see if the date is valid ?
 
Rather than prompting from the query, create a form where the two dates are entered and a button to run the form/report/query. The query should reference the date fields on the form. In the click event of the button, use the IsDate() function to check each date and provide a meaningful message. Of course if any error is found, don't run the form/report/query.
 

Users who are viewing this thread

Back
Top Bottom