[AccessD] Sum a union query

Kaup, Chester A kaupca at chevrontexaco.com
Thu Dec 2 16:33:55 CST 2004


Can I do this in a union query? Generates error of no aggregate function
for ACTVDATE.
Select ACTVDATE, Sum(Exp1), Sum(Exp2)
From
(SELECT ACTVDATE, Sum(VOLUME_SS) as Exp1, Sum([VOLUME_SS])*0.335849 as
Exp2
FROM T9CAT_GAS_MTR_READINGS
WHERE GASMTRIDNO IN (605954,605955,605956,425030) and
ACTVDATE>=#10/1/2004#
GROUP BY ACTVDATE
ORDER BY ACTVDATE
UNION
SELECT ACTVDATE, Sum([VOLUME_SS]*-1)as Exp1, Sum([VOLUME_SS])*-0.335849
as Exp2
FROM T9CAT_GAS_MTR_READINGS
WHERE GASMTRIDNO=605957 and  ACTVDATE>=#10/1/2004#)
GROUP BY ACTVDATE
ORDER BY ACTVDATE;

Chester Kaup
Information Management Technician
IT-MidContinent/MidContinent Business Unit
CTN 8-687-7415  
Outside 432-687-7415

No trees were killed in the sending of this message. However a large
number of electrons were terribly inconvenienced. 






More information about the AccessD mailing list