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!

Between Dates Or ALL Dates query

Status
Not open for further replies.

eti3nne

MIS
Feb 5, 2004
102
How would I construct a query that allows for parameters of start and end date (eg a between start and end expression - such as ... Between [Enter Start Month as mmm yyyy] And [Enter End Month as mmm yyyy]) that ALSO allows for entering of * to select ALL dates?

Thanks for looking.
 
what you can do is enter this in the query in the date field

>=IIf(IsNull([start date]),#01/01/75#,[start date]) And <=IIf(IsNull([end date]),#01/01/25#,[end date])

You can alter the default start and end dates if you wish.

Any issues let me know. You could use text boxes on a form if you wished. If you are unsure how to alter the code to do this let me know and i can show you how.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top