Running Totals

Printed From: Crystal Reports Book — Forum Name: Technical Questions

Would you know why my 5YearTotal column displays the total value on the next row, instead of the current?

I have the following formula in my Detail Section;

whileprintingrecords;
Global numbervar RunningSalesTotal5YR;
Global numbervar RunningSalesTotalParmDates;
Global datetimevar StartBillDatePlus5Yrs;


If ({#RunningTotal} > 9999) and ({Bill_Date} <= StartBillDatePlus5Yrs) then RunningSalesTotal5YR := {#RunningTotal};

My results show up as following;

TotalBilled     RunningTotal     5YearTotal
479.60          9,592.00          0.00
719.40          10,311.40        0.00
479.60          10,791.00        10,311,40
119.90          10,910.90        10,791.00
119.90          11,030.80        10,910.90
I believe that the whileprintingrecords and Running Totals both execute in Pass 2. The RT should execute just before the PrintTime formulas.
Do you have more than one detail section? items in Detail a will run before detail b.