我有2個表無論是否加入2個選擇查詢。記錄
table 1 table 2
------------------ ----------------------
description paidamt description recievedamt
ele. bill 200 donation 1000
stationary 500 fees 200
salary 1000
,我想導致以下格式(數據將在日期的基礎上進行排序)
description debit credit
---------------------------
ele. bill 200
donation 1000
stationary 500
fees 200
salary 1000
事情是,當我設置AMT借記然後我不能將信用欄設置爲空白,或者當我設置信用額度欄時,我不能將借項欄設置爲空白。我是工作在下面的查詢....
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;
我想加入這兩個查詢
根據需要給出結果...讓我繼續努力..將盡快回復你..謝謝qik回覆 –
我已經使用你的查詢和工作在很小的變化和日期的基礎上排序很好......沙克斯很多! –