Thanks guys!
lbass,
That's not the case since my formula doesn't look the way I posted it before. I posted it that way so that it would be easliy readable. The way it really looks is this:
Code:
[COLOR=blue]whileprintingrecords[/color];
{@Job1Count}/3;
synapsevampire,
Here's the deal. What I have is a formula called @Job1Count that counts the number of certain items in the database. The text of @Job1Count is as follows:
Code:
[COLOR=blue]if[/color] {MyTable.JobNumber} = 1 [COLOR=blue]then[/color]
1
[COLOR=blue]else[/color]
0
This formula is in the details section (which is suppressed) and it simply returns 1 for all records where the JobNumber field is 1.
Note:
The details section of my report is suppresed and I display the data using the headers/footers of groups in the report.
In a group footer, I have a summary field which is the
Sum of the @Job1Count formula. So, when the report prints, this summary field (the sum of @Job1Count) will display, let's say, 450 and that would be the total number of records in the database where JobNumber is 1. That 450, though, is distributed in x number of days (let's say 3) and what the user wants to see is the average of Job1Count in those 3 days. Thus, instead of displaying 450, I need to display 450/3 = 150.0 which would be the average number of Job1 occurances in each day. Using an
Average summary instead of a
Sum does not work because the average is computed as
TotalSum/NumberOfRecords. This, as you may already know, does not make sense here because the average I want is
TotalCount/NumberOfDays, and thus I have to compute the average manually. So, I need a way to access the Sum of @Job1Count so that I could divide it by the number of days and show it to the user. How can I access the total sum of @Job1Count?
Here's some info about my environment.
I'm using Crystal Reports 10 Developer Edition, reporting of a SQL Server 2000 database.
Thanks again!
JC