Date range in a report

C

Connie

I have a query. In the query, I have a date field which is a date range. I
would like to include this date range automatically on a report heading
instead of typing it in everytime. I believe I have done this before and it
is quite easy, but I forgot.

Please help.
 
J

Jeff Boyce

Connie

It sounds like you are using a pair of parameters in your query to limit the
value in the date field to a range of dates.

If I needed to "capture" those dates to include in a report, I'll backup and
start from a form. In the form, I'd add a couple textboxes and enough
labeling to show that the user needed to enter the dates ("FROM", "TO") in
the textboxes. Then I'd modify the query to "point" at the form to get the
parameters (Forms!YourForm!FROM ...) -- and of course the form would need to
be open for this to work.

Finally, I'd add a command button on the form that opens the report. The
report is based on the query. The query uses the date range in the form.
And the report includes the same kind of reference to the form to get the
dates to show in the report! (e.g., Forms!YourForm!FROM...)

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
K

KARL DEWEY

I have a date field which is a date range.
A datetime field can not be a range. Maybe you mean you pull records with
a date range criteria on the field.
If so, then one way is in query design view scroll to the right to an blank
in the Field row and paste your criteria like this ---
Report_Range_Dates: Between [Enter start date] And [Enter end date]
then edit it to this --
Report_Range_Dates: [Enter start date] & " - " & [Enter end date]

The reason for pasting the criteria is to make sure that the entry here is
exactly as in the criteria row.
 

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