I still don't know what you want as you haven't show us what output you expect. My GUESS is that you want to GROUP by the acc_code:SELECT acc_code, SUM(sdebit) AS sdebit, SUM(scredit) AS screditFROM( SELECT acc_code,sum(debit) as sdebit,SUM(credit) as scredit FROM OR_child WHERE [acc_code] IN (SELECT CodeID FROM Codes WHERE CodeType = 'INQMISC') AND doc_date <= '02/22/2014' AND Mem_Code = '13184' GROUP BY Acc_Code Union SELECT acc_code,sum(debit) as sdebit,SUM(credit) as scredit FROM JV_child WHERE [acc_code] IN (SELECT CodeID FROM Codes WHERE CodeType = 'INQMISC') AND doc_date <= '02/22/2014' AND Mem_Code = '13184' GROUP BY Acc_Code Union SELECT glaccount as acc_code,0 as sdebit,SUM(amount) as scredit FROM glxacts WHERE [glaccount] IN (SELECT CodeID FROM Codes WHERE CodeType = 'INQMISC') AND createdate <= '02/22/2014' AND cardid = '13184' GROUP BY GLAccount) AS TGROUP BY acc_code