Selasa, 23 Juli 2013

Quary Cara lihat transaksi KIPA perperkara

select A.tgl_trans, B.keterangan,
SUM (CASE WHEN B.debet=1 THEN A.nil_trans ELSE 0 END) AS DEBET,
SUM (CASE WHEN B.debet=0 THEN A.nil_trans ELSE 0 END) AS KREDIT
from trans_perk A, var_perkiraan B
where
A.var_perk=B.kode AND
A.tingkat=0 and A.no_perk='0001G12'
GROUP BY A.tgl_trans, B.urutan,B.keterangan,A.var_perk
order by A.tgl_trans,B.urutan, A.var_perk asc