i think this will help...

select sum(opbal) as TDR from gen where opdc = 'D'

select sum(opbal) as TCR from gen where opdc = 'C'