I have 2 tables
table 1 table 2
------------------ ----------------------
description paidamt description recievedamt
ele. bill 200 donation 1000
stationary 500 fees 200
salary 1000
and I want result in following format (data will be sorted on basis of date)
description debit credit
---------------------------
ele. bill 200
donation 1000
stationary 500
fees 200
salary 1000
matter is, when I set amt to debit then I can not set credit column as blank or when I set amt to credit of perticular column then I can not set debit column as blank. I was working on following query….
WHEN Payment_Voucher_Master.grand_tot <> '0'
THEN ''
ELSE 'dgf'
END credit
FROM Receipt_Voucher_Master,Payment_Voucher_Master
GROUP BY Payment_Voucher_Master.PaidTo,Payment_Voucher_Master.grand_tot
SELECT Receipt_Voucher_Master.PaidTo
AS description, Receipt_Voucher_Master.grand_total as credit,
CASE
WHEN Receipt_Voucher_Master.grand_total <> '0'
THEN ''
ELSE 'dgf'
END debit
FROM Receipt_Voucher_Master,Payment_Voucher_Master
GROUP BY Receipt_Voucher_Master.PaidTo,Receipt_Voucher_Master.grand_total;
I was trying to join these 2 queries
1 Answer