Query Parameter - Between and and operator

M

Maran

I want to supply a parameter to a query to define the from date and to date
and retrieve data falling under this from and to date.

but, i do not want it to be prompted, as the same criteria is to be used in
more than one table.

so, i want to store the from date and o date in a temp table and related
this to the date field in different tables.

thanks
 
D

Duane Hookom

You could create a table (tblDateRange) with 2 date fields (datStart and
datEnd) and only one record. Then add tblDateRange to your query and don't
join it. Set the criteria under your date field to:
Between [datStart] and [datEnd]

This works well for reports but doesn't allow editing of the results. If
editing is a requirement, you will need to remove the table and use a
criteria like:
Between DLookup("[datStart]","tblDateRange") and DLookup("[datEnd]",
"tblDateRange")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top