parameter Query-between

wakiwi

Registered User.
Local time
Today, 14:52
Joined
Mar 2, 2005
Messages
14
I am trying to run a between start and end date parameter query that will also allow all records to be pulled up. I can't get the wildcard"*" to work. If I use it all records come up no matter what dates are entered in the " Start" and "End" date boxes. The query works fine without the * , but I need the option of gettting all records.
 
I have attached a sample database, which contains the Orders table from the NorthWind sample.

You can open the form and click on the command button to run the query. When either the start order date or end order date text box is left blank, all order dates will be pulled.
.
 

Attachments

parameter query-between

Thank you so much! I was able to modify that to work on my Query! I have another question that you may be able to answer-Is there a way to have the Start and End dates that a person enters in the Query boxes to print on the report? Then the client could see the time interval that was used for the Query on the report itself.
 
The user has to type the start date and end date in two text boxes on a form just like in my sample.

Then put two text boxes on the report. In their Control Source properties, reference the respective date text box on the form e.g.

=Forms!SearchForm!txtStartDate
.
 
parameter Query

Thank-you Jon! I was trying to avoid using a form, but I see that it will make it a lot easier to get what I need.
 
How would you go about requesting query request of Primary Key value OrderIDs?

[OrderID] Between [forms]![SearchForm]![txtStartOrder] And [forms]![SearchForm]![txtEndOrder] Or [forms]![SearchForm]![txtStartOrder] Is Null Or [forms]![SearchForm]![txtEndOrder] Is Null

This doesnt work it pulls back nothing for that query... thanks for your help
 

Users who are viewing this thread

Back
Top Bottom