Hai !

I am working with Crystal Reports 8.5 ver.
I have designed a report from a query. in the report I wanted to have a formula fields namely BALANCE and DRCR.
what i mean to ask is ..... if there is a value which is returned in one record how to pass it to the next record?

I want to have the values of BALANCE , and DRCR columns as follows...

AccountName --- DebitAmount --- CreditAmount --- BALANCE-- DrCr
----------------- ---------------- ------------------ --------------- - -------
acc1---------10,000.00-----------2,000.00----------8,000.00----D
acc2-----------3,500.00---------13,500.00----------2,000.00----C
GTB-----------5,000.00---------------0.00-----------3,000.00 ---D
cash---------------0.00----------2,500.00------------500.00---D
polo----------4,000.00----------6,000.00----------1,500.00--C

totals : 22,500.00 ------- 24.000.00 ------

for the first record the balance will be DEBIT - CREDIT if value is positive DrCr should be 'D' else 'C'. if the BALANCE is Debit then it should be added to the next record's DEBIT and the sum should be subtracted by CREDIT, otherwise the BALANCE should be added to CREDIT and sum should be subtracted from DEBIT... and the balance should be displayed....
and so on.....

[ Note : the difference of the sum of DEBIT AMOUNTS and the sum of CREDIT AMOUNTS should be equal to the final value of the BALANCE column... i.e. the sum(DEBITS) - SUM(CREDITS) in the above example is equals to 1,500 and it is C(credit) balance.]

Thanks in advance...