or you could incorporate the counting into your formula
something like this
Set an initialize formula to set the total and count to zero in the group header
@Initialize
WhilePrintingRecords;
if not inrepeatedgroupheader then
(
Numbervar ReportTotal := 0;
NumberVar iCount := 0;
);
then in your formula that you are using do something like
WhilePrintingRecords;
Numbervar ReportTotal ;
NumberVar iCount ;
StringVar result := "";
...(rest of your formula until here)....
If (Checks a Date for aging is true) then
(
ReportTotal := ReportTotal + {Table.AccountBalance};
Icount := Icount + 1;
result := totext({Table.AccountBalance},2);
);
result;
then later you will have display formulas to show the values for total and average...eg:
@display
WhilePrintingRecords;
Numbervar ReportTotal ;
NumberVar iCount ;
"Total Account Balance: " + totext(ReportTotal,2) +
chr(13)+ chr(10) + chr(13)+ chr(10) +
"Average Balance : " + Totext(reportTotal/icount,2) +
" based on " + totext(icount,0) + "Non-zero accounts";
That should do it
JimBroadbent@Hotmail.com
Reward good advice with a star, it reinforces us and helps others find answers to their problems.