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

Toals on formulas resulting from shared variables

Status
Not open for further replies.

rrtraverse

Programmer
Jul 2, 2002
26
US
Since I came here yesterday and received help passing my shared variable correctly to my main report, I have a shared variable repaidDate in my Main report which I can use to subtract from a loan initiation date in my Main report to get a number of days figure for each Loan ID.

Now I need to sum the number of days for each Loan Id to arrive at a subtotal number of days by customer, and a grandtotal number of days. To make matters worse, I also need an average number of days per customer.

My report is grouped by Customer, then by Loan ID.
The subreport is in GH2b - by Loan ID. I have a copy of the subreport in GH2a to suppress blank subreport sections. I reset my shared variable repaidDate in GH2b.
My Details are in GH2c.

Can anyone help?
Thanks
 
Any formula that uses a shared variable cannot be used in total (sum, average, etc.) operations because the formula gets evaluated in the 2nd-pass and crystal can't use 2nd-pass formulas in aggergate operations.

Consider returning the necessary date information (that is currently in the subreport) in the result set for the main report. This would avoid the need to use shared variables.
If you can't do this using simple joins, consider creating a View (query in MS Access), Stored Procedure, or Command (CR 9) as the data source for the report. This would let you use more complex SQL (subselects).

hth,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top