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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date range to print on the report 1

Status
Not open for further replies.

TadyB

Programmer
May 21, 2004
42
0
0
US
Hey.
I have an invoice report with a query that prompts the user for a date range based on the InvDate. Is there an easy way to get that date range printed on the report?

I don't have my invoice items listed individually, just the total for items purchased for that date range. I would like to have a line that reads: "Snack Bar charges from (Begin Date) through (End Date)."

Thanks,
Stacey
 
If the Record Source query is prompted for the Begin and End dates then there are designations in the SQL that can be used just like variables in the report.

Example:
Code:
Select A.*
FROM yourtablename as A 
WHERE A.InvDate Between [red][Begin Date][/red] and [/red][End Date][/red];

Look for the prompted variables within the Square Brackets in your SQL. You can use them just as stated(exact spelling of course) in the query in your report text control for display purposed. In your control on your report use something like the following:

Code:
="Snack Bar charges from " & [Begin Date] & " through " & [End Date] & "."

Post back if you have any questions.


[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
OMG...that was so cool!

I've never looked in my SQL before...so much to learn...it works perfectly...thanks sooooooo much!!!

Stacey
 
Glad to be of assistance. Thanks for the Star.

You definately want to learn SQL as there are times where the QDW in ACCESS queries cannot produce easily the code that is necessary. The best way to learn is to create a query in the QDW and then open the SQL window and see how it converted to the actual programming language.

Good luck.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Ok, thanks...I will try that...can't wait to learn!

Stacey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top