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!

New at sub reports. Passing date ranges??

Status
Not open for further replies.

PQTIII

IS-IT--Management
Sep 21, 2004
110


This is my first time that I have dealt with sub reports (CR9). I get a date range from a parameter input screen when the report is ran and want to use (group) that same input range on a sub report. What is the easiest way to accomplish that task??? Is there a standard way of passing parameters from the main report the the sub?

Paul
 
From the main report right click on the subreport and click on change subreport links.

On the pop up, add the parameter from the left to the right using the ">" button

On the bottom part, check the database link box and then specify the {table.date} that you want it to link. Do the same with the other date parameter.

Edit the subreport and click on select expert-> formula editor and complete or verify the link

{table.date} in {pm-?datefrom} to {pm-?dateto}

-LW
 
C V9 - I have a 'Crystal' report that I need to run three different times with various date ranges. Is there a way I could write three different 'Stored procedures' with the different date ranges, but use only one 'Crystal Report'?

See Example: 200 CL report (grouped by salesrep)

1st daterange:
Compare Current Period Week through Prev Sunday
11/29/04 - 12/12/04
Compare Last Year Same Period Week - Prev Sunday
12/01/03 - 12/14/03

2nd daterange:
Compare Current Year Period
11/29/04 - 12/26/04
Compare to Last Year Same Period
12/01/03 - 12/28/03

3rd daterange:
Compare 1st Day of Current Period thru Prev Sunday
11/29/04 - 12/12/04
Compare to 1st Day Last Year Same Period (all period)
12/01/03 - 12/28/03

Example: CY Revenue (for period)
IF {mc_period_dates.period} = {paramdates.period} AND
{mc_period_dates.period_year} = {paramdates.periodyear} THEN

{mc_ad_cost_view.credit_amt} - {mc_ad_cost_view.debit_amt}

Example Field: LY Revenue
IF {mc_period_dates.period_year} = {paramdates.periodyear} -1 and
{mc_period_dates.period} = {paramdates.period} then

{mc_ad_cost_view.credit_amt} - {mc_ad_cost_view.debit_amt}

I also have variables for Week to Week, etc.

I would appreciate any help. Thanks in advance.

brxmas

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top