Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using parameters to limit a date field in a Query

Status
Not open for further replies.

sara82

Technical User
May 20, 2005
78
US
I am limiting a report to a date range using parameters in a query.
If the user, for instance, wanted to display all the dates.. when the parameter pops up asking for a start date, the user will not enter anything and just click OK, when the parameter pops up for end date, the user will not enter anything and just click OK. And then the report should list all dates.

This is in my critera row under the date field:
Between Nz([Enter Start Date],[BasicDate]) And Nz([Enter End Date],[BasicDate])

The problem now is that there are some records don't have a date entered. If the user doesn't enter a date when prompted, I would like the report to list ALL records the ones with the dates and ones without a date.

How would I be able to view both?
 
You may try something like this:
(Between [Enter Start Date] And [Enter End Date]) Or [Enter Start Date] Is Null Or [Enter End Date] Is Null

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks so much, it's now giving me the results that I need.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top