Date range in query

bernie

New member
Local time
Today, 12:14
Joined
Feb 8, 2007
Messages
3
Hello all

I was wondering if anybody could help me out with a query problem I've been having.
I've been trying to use a query to display a list of available cars for a given start and end date entered by the users. I have found some guidance to make an attempt but it isn't working. The text in the Input boxes isn't what I'd like. Also the query is displaying all the cars in my database even when I deliberately trying to exclude some.
I'd really appreciate any help As this is my first database and Im really struggling with the use of criteria.
I've included a screen grab including my formulas

http://img.photobucket.com/albums/v242/b3rnie/access_screen.jpg

Apologies if I've missed this advice in my searching
 
In the criteria for the date in your query enter the following:

Between [Start Date] And [End Date]

The query will then prompt you to enter a Start Date and an End Date.

Enter the appropriate dates at the prompt. Don't forget to use the same date format as you have in your table. This should solve your problem.
 
statsman said:
In the criteria for the date in your query enter the following:

Between [Start Date] And [End Date]

The query will then prompt you to enter a Start Date and an End Date.

Enter the appropriate dates at the prompt. Don't forget to use the same date format as you have in your table. This should solve your problem.

Just to add to what Statsman said:

If you are going to use a form to search for this data (and maybe have a subform display the results) you can use the same principle and use the following in your query along with any other criteria you may want:

Where Yourtable.Date between forms!YourFormName!YourTextBoxName and forms!YourFormName!YourTextboxName.

Using one of my DBs as an example, it would look like this:

Code:
And (tblPass.Date_Issued Between Forms!frmPassDates!txtBegDate And Forms!frmPassDates!txtEndDate)
 

Users who are viewing this thread

Back
Top Bottom