Query parameters can filter a dataset to show only those records that meet various conditions based upon dates. In this example three different conditions are being applied:
The menu option Query | Parameters allows you to define the parameters prompts that the user will see and also the data types (i.e. Date/Time). The two user parameters can both be applied to the 'Date_Out' field in order to select a range of dates
Param-Dates01: Select Query
|Criteria:||Between [Date from] And [Date to]||>=#01/04/2005#|
|Or:||Between [Date from] And [Date to]||<Now()-10|
Would you like to learn more?
In order to specify a permanent date within a parameter, it must be entered between hash # symbols.
In the example there are two alternative criteria for the Invoice date (after 1st April 2005 and more than 10 days old). This necessitates that the other criteria is repeated so that it gets taken into consideration on both rows. If the 'Date From'/'Date To' parameters were only applied on the first criteria row the records would be filtered so that:
The Now() function returns today's date and therefore Now()-10 is the date 10 days ago.
an Access database for
|file: access-date-param01.htm||Page last updated Oct 06||© MeadInKent.co.uk 2006|