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

Date range parameters based on dissimilar dates

Status
Not open for further replies.

brendanj68

IS-IT--Management
Oct 1, 2003
41
0
0
GB
Hi All,

Am using CR9 with SQL2000. My report has two aims (main rpt - show a cumulative monthly total of new Projects (monthly value, based on 'View1') and via a subreport another cumulative monthly total for invoices raised during the same monthly period as new Projects but via a 'View2'. I have searched the site but not found anything that has provided a solution to enable the main report Project Start and End Dates (which both must be chosen) to allow me to pick up invoices raised during the same time period as the select on the main rpt.

To outline the main report structure and explain what I hope to achiweve:

GH1 - Start Date (Sup)
GH2 - Project_Id (Sup)
GH3 - Region (Sup)
D to GF1 - Blank (Sup)
RFa - Calc1 @SortChoice
RFb - Calc2 x
RFc - Calc3 - Project Value (based on @SortChoice and RFf & RFg)
RFd - Calc4 (monthly Total Income derived from Subrpt placed here utilising View2)
RFe - Calc5 y
RFf - Calc6 / RFg - Calc7 - Part of 3 stage formula
RFh - Calc8 z
RFi - Calc9 zz
RFj to RFo X-Tabs/ Charts

There was no way to use a single view to capture both sets of date data as one to many relationships caused problems. I hope that this makes sense , as I have had to simlify aspects of the design so as not to totally bewilder everyone. Thanks in advance (once again)
 
Here's an overview of using and passing parameters.

To use 2 different parm dates in the main report select report->Edit Selection Formula->Record and use something like:

{table.field} >= {?startdateparm}
and
{table.field} <= {?enddateparm}

Then to use these 2 parms in the subreport, use the change linking (right click the subreport and select change links or some such) to link the main report parms to the field in the subreport (should be simple enough), and then open the subreport for editing and edit the record selection formula afterwards:

If should show something like (I don't have Crystal in front of me right now):

{subtable.field} = {?pm startdateparm}
and
{subtable.field} = {?pm enddateparm}

Alter it to use the same sort of thing as the main report:

{subtable.field} >= {?pm startdateparm}
and
{subtable.field} <= {?pm enddateparm}

Now the parms selected in the main report can be used in the subreport.

Hope this helps.

Another solution would have been to use a date range parameter.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top