Summing 2 subqueries

bd528

Registered User.
Local time
Today, 11:34
Joined
May 7, 2012
Messages
111
Hi,

I'm using the SQL below in Access 2010 :-

Code:
SELECT tblMerged.Col4, 
(select sum(dupe.col8)
from tblMerged as dupe
where dupe.col4 = tblMerged.col4
and dupe.col2 = "I"
group by col8) AS Expr1, 
(select sum(dupe.col12)
from tblMerged as dupe
where dupe.col4 = tblMerged.col4
and dupe.col2 = "U"
group by col12) AS Expr2, 
(select sum([dupe.col11])
from tblMerged as dupe
where dupe.col4 = tblMerged.col4
and dupe.col2 = "C") AS Expr3
FROM tblMerged
GROUP BY tblMerged.Col4;

What do I need to add to this so that I can have another column showing Expr2 & Expr3 added together?

Many thanks.
 

Users who are viewing this thread

Back
Top Bottom