>:( after i asked i found my mistake and solved my problem ,
>if any good suggest will be very appreciated
>
>
>Local lnRemainder
> m.Remainder = 0
> Go Top
> Scan
> Replace CrsResult1.Remainder With m.lnRemainder + CrsResult1.debit - CrsResult1.credit In CrsResult1
> m.lnRemainder = CrsResult1.Remainder
> Endscan
>
Hi Soykan,
Our accountants calls this 'running balance' and is very common
calculation in accounting statements/balances of all sorts.
If Scan/Endscan is already used to prepare report info
then I differ from Hilmar here, and prefer it precalculated in that very cursor rather then using report variables.
However, if data are previosely extracted via some SQL procedure,
and all you do here is additionaly calculating that running balance,
then I agree with Hilmar, because report variables spares you of need
(time) for that additional loop on basically the same data.
BTW Wldn't it be simplier like this ?
Local lnRemainder
m.lnRemainder = 0.00
Go Top
Scan
lnRemainder = lnRemainder + crsResult1.debit - crsResult1.credit
Replace CrsResult1.Remainder With lnRemainder
Endscan
2c