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

Include Query Parameter within report title. 1

Status
Not open for further replies.

SQLBI

IS-IT--Management
Jul 25, 2003
988
GB
Hi,

I have the following SQL which is used to populate an Access 2000 report.

Code:
SELECT CR.ReasonID, CR.Reason, COUNT(C.BookingID) AS [No of Cancellations]
FROM ((tblCancellation AS C INNER JOIN tblCancelationReason AS CR ON C.ReasonID=CR.ReasonID) INNER JOIN tblCourseBooking AS CB ON C.BookingID=CB.BookingID) INNER JOIN tblScheduledCourse AS SC ON CB.SchCourseID=SC.SchCourseID
WHERE SC.StartDate BETWEEN [Enter FROM date - dd/mm/yyyy] AND [Enter TO date - dd/mm/yyyy]
GROUP BY CR.ReasonID, CR.Reason
ORDER BY CR.ReasonID;

I would like to use the 2 date parameters within my report title e.g. "Cancellations for the period - [date1] to [date2]" but i've no idea how to do it.

Is this possible and if so, how?

Thanks in advance.


Leigh Moore
Solutions 4 MS Office Ltd
 
Hi,
Check the microsoft downloads. Many databases are available to your requirement. They use a form to pass the parameter and direct the textbox of the report to the form to display the two dates.
In simple use use a form to pass the parameter and on the report make textbox display the given dates from the form.
Check this link


Zameer
 
Add a text box with a control source of
="Cancellations for the period - " & [Enter FROM date - dd/mm/yyyy] & " to " & [Enter TO date - dd/mm/yyyy]


Duane
MS Access MVP
 
nope, try it... YOu must use exactly the same parameters.

Duane
MS Access MVP
 
Hi Duane, I just did this and it did prompt twice. I am using the exact same parameters. I have done this before and it worked fine, but this time it is prompting twice. The only difference is the query with the date parameters is feeding into a crosstab query and then the crosstab results are the data source for the report. Would this make a difference?

Dawn

 
Create columns (row headings) in your crosstab with:
FromDate:[Enter FROM date - dd/mm/yyyy]
ToDate:[Enter TO date - dd/mm/yyyy]
You can use these like any other field/column in your query.

Duane
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top