show date parameters in report

H

heavenlyhost1

The report I'm creating is from a query which has a parameter in the date
field so that the user can select a start date and end date. I would like
the start date and end date to also show on the report. Can this be done?
 
T

tkelley via AccessMonster.com

Try this: Add a textbox for each on the report. In each box's control
source, put the same thing you have in your query's criteria.
 
K

Ken Snell MVP

Add two calculated fields to your report's query, one for each parameter.
Bind textboxes on the report to those two fields to display them.

For example:

SELECT *, [Enter Start Date:] AS StDate,
[Enter End Date:] AS EnDate
FROM YourTableName
WHERE YourDateField Between [Enter Start Date:] And
[Enter End Date:];
 
H

heavenlyhost1

Thank you so much for sending this. I was confused at first because "put the
same thing you have in your query's criteria" threw me off. I kept trying to
put the Between [Enter Start Date] and [Enter End Date] in the text box but
this didn't work. All I had to put in the Control Source was [Start Date] in
one text box and [End Date] in the other text box. Works beautifully, but
without your suggestion, I would not have figured it out. Thanks. again.
 
H

heavenlyhost1

While this probably would have helped someone who knows SQL or VB, I do not,
so I couldn't figure out where to put this and kept getting all kinds of
errors because I didn't know what I was doing. I need more basic
instructions with plenty of detail. I was able to figure it out using
tkelleys help, even though I had a little trouble with hers, but it did
enable me to eventually figure it out. So thank you so much for trying to
help me. It was my fault that I was unable to figure it out.

Ken Snell MVP said:
Add two calculated fields to your report's query, one for each parameter.
Bind textboxes on the report to those two fields to display them.

For example:

SELECT *, [Enter Start Date:] AS StDate,
[Enter End Date:] AS EnDate
FROM YourTableName
WHERE YourDateField Between [Enter Start Date:] And
[Enter End Date:];

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


heavenlyhost1 said:
The report I'm creating is from a query which has a parameter in the date
field so that the user can select a start date and end date. I would like
the start date and end date to also show on the report. Can this be done?
 

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