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!

Passing date formula from main to sub report

Status
Not open for further replies.

jcl5

IS-IT--Management
Dec 6, 2002
89
GB
Hi guys, hope you can help

I have a report full of different running totals that display results quarterly.
The formula for 'Quarter1' is {SALES.SALES_DAT}in Date (2003, 07, 01) to Date (2004, 06, 30).
In my running total I evaluate on Quarter1=True.

Next I want to drill-down using a sub-report but I want to pick up 'Quarter1' from the main report.

At the moment I am passing the parameter using the sub-report links but that means I have to have the formula in both reports and as there are about 50 sub-reports I don't want to have to change the formula dates in every sub-report every year.
I thought I could do this using shared or global variables but I don't know how to write the syntax. Can someone help or suggest a better way of doing it.

Many thanks

jcl5

 
You might derive the year portion of the date from either the system date or a parameter, as in:

Date (year(currentdate)-1, 07, 01) to Date (year(currentdate), 06, 30).

Subreports are very inefficient, depending upon where they are executing (for instance in Groups or Details) so you should consider a different approach, but I won't advise without technical information, such as:

Crystal version
Database/connectivity used
Example data
Expected output

In general you're better served to use a View or a Stored Procedure on the database.

Another approac is to create a subquery using a SQL Expression.

-k
 
OK thanks

I'm using Crystal 9 with Oracle 8i

My report is like a manual cross tab in that all the fields are in the report footer.
The output is in the format of:-

Outputs April May June July Aug

Total Sales 10000 12000 12345 12987 15000
Group1 Sales 4000 5000 4567 9876 9000
Group2 Sales 6000 7000 7778 3111 6000

.. but covers the whole year with fifty different outputs. This report will run year on year and I don't want to have to hard code the date in every sub-report hence trying to pass the date parameter using {sales.sales_dat}.


What I want to do is drill down on each of the totals to see the records.

Does this help?

Many thanks

jcl5
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top