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

Date parameter in main report, dates in 3 sub reports 1

Status
Not open for further replies.

gillf

Technical User
Aug 14, 2002
35
GB
I have a report containing 3 subreports. I need to put a parameter for "transactions dated up to" in the main report, but the transaction dates are held in the subreports. Step by step guide for a numpty, please?
 
I will assume you have a report with the subreport already created. In the main report, you need to create the date parameter. Click on the "insert fields" icon, then click on "Parameter Fields" and click the "New" icon at the top. Give the parameter a name (let's say "enddate for now"), the prompting text and the Value Type (this MUST be the same as the date format you are using in the sub-report, i.e. if one is a Date and the other is a DateTime, it will not work - you can come back and change this later if need be). Save the Parameter.

Next, right click on the subreport in the design window and chose Change Subreport Links. Under available Fields, you should have something like "[?] ?enddate", click on this and then click the ">" buttno to add it as a link. At the bottom of the Subreport Links window, you should now have
"?Pm-?enddate" in the left box, ensure there is a tick in the "Select data in subreport based on:" box and choose the correct field in the drop down box (If you got the wrong choice of Date or DateTime when setting up the parameter, the date field in your table will not appear, go back and change it!). Then click OK to save this. At the moment, this will create a direct link date to date as opposed to the link you need (i.e. one date is less than the other).

Now, open the subreport and click on the "Select Expert" icon, you shuold have an entry for your date field which says "is equal to" and {?Pm-?enddate}. Click the drop down box next to "is equal to" and change it to "is less than or equal to" and click OK.

This should be all you need.
 
Thanks! Very clear & helpful & worked first time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top