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

Cannot create subtotal--help

Status
Not open for further replies.

digilantis

Technical User
Jul 16, 2001
19
US
I seem to be having trrouble creating a subtotal in CR 8.5
Here is the scenario
I have one group
I have one formula @Zone1

WhilePrintingRecords;
NumberVar TotalSec := {Results.LCTIME};
NumberVar Days := Truncate (TotalSec / 86400);
NumberVar Hours := Truncate (Remainder ( TotalSec,86400) / 3600);
NumberVar Minutes := Truncate (Remainder ( TotalSec,3600) / 60);
NumberVar Seconds := Remainder ( TotalSec , 60);
StringVar Zone1 := ToText(CDateTime(Totext ( Hours, '00', 0,'') + ':'+ Totext ( Minutes,'00', 0,'')));

IIf(CDateTime(Zone1) >= #9:00AM# And CDateTime(Zone1) <= #4:59PM#,1,0)

I want to sum in the groupfooter
It produces the values for each record but when I try to use the subtotal in the menu it does not see @Zone1
If I Try Sum(@Zone1,mytable.myfield}) it gives me
&quot;the summary / running total field could not be created&quot;
What am I doing wrong?

thanks in advance
 
Since your @Zone1 formula is evaluated
during the second pass (WhilePrintingRecords)
it is not available for any aggregate function
(since those execute at that pass too.

One option is to simply create the necessary sum
by accumulating it in another variable.

Cheers,
- Ido
ixm7@psu.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top