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

Date Parameters to Subreports 1

Status
Not open for further replies.

Yerdon

Programmer
Jul 29, 2002
62
US
Hi,

Does anybody know how I can pass a DATE RANGE parameter from the main report to a sub-report? When I try to edit the subreport links and add the parameter, it brings up a blank list of fields to link to.

The sub-report already has one link: an ID field which works great. However, I want to pass the date range for the main report to the sub-report in order to filter out results.

Any ideas?

Thanks!

Joseph
 
I don't belive you can pass a Date Range in which case you will have to create two formulas and pass them

//@DateFrom
Minimum({?DateRange})

//@DateTo
Maximum({?DateRange})

Cheers,
-LW
 
If you put the date range parameter in both the main and sub reports and link the reports by the date parameters, the parameter values from the main report will be passed to the sub report.

MrBill
 
I'll try to clarify here.

If you have a main report date range parameter, you can then create a subreport date range parameter, and link the parameters, then in the subreport use the date range parameter from the subreport for the record selection.

The downside may be that with certain viewers you might see 2 sets of datetime parameters, and worse yet, users rarely need a datetime parameter, a date type will suffice, so I would consider using a date type and converting it to a date time to suit your needs.

If you decide to create formulas, converted to dates or left as datetimes, you don't need a parameter in the subreport, as you alluded to, you can just link to the date field (once for mini , once for max), however this will require some additional editing of the subreport record selection formula.

You could create the formulas as Witchitas suggests, but if you point to them in the linker in Crystal, it will create an = type join, so go into the subreport record selection formula and manually change it to >= the minimum and <= the maximum.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top