Hi

I have a table contains the ledger name, op balance and opdc for dr/cr
Gen Table: (Name, OpBal, OpDc)

I want to sum the opbal for opdc='D' and opbal for opdc='C'

Formula:

NumberVar Tdr;
NumberVar Tcr;
if {Gen.Opdc}='D' then
Tdr:=Tdr+Sum({Gen.opbal})
else
Tcr:=Tcr++Sum({Gen.opbal})


Pls guide how to get the result.

Thanks

Asm