H
Hendy88
Hello,
I want to sum the values together that are returned from the following
two queries joined with a UNION from within the same query (instead of
creating a second query that will SUM the two values that are produced
from this one). I tried "wrapping" this code within a SELECT SUM, but
it returns with "this is not allowing in subqueries".
SELECT Count(*) AS SubCount
FROM [TABLE1]
WHERE (([TABLE1].USER)="JOHNSMITH")
UNION ALL SELECT Count(*) AS SubCount
FROM [TABLE2]
WHERE (([TABLE2].USER)="EJONES");
The results are:
SubCount
--------------
380
45
But, as I mentioned, from with the same query I want the following:
SubCount
--------------
425
Any ideas?
Thanks in Advance!
I want to sum the values together that are returned from the following
two queries joined with a UNION from within the same query (instead of
creating a second query that will SUM the two values that are produced
from this one). I tried "wrapping" this code within a SELECT SUM, but
it returns with "this is not allowing in subqueries".
SELECT Count(*) AS SubCount
FROM [TABLE1]
WHERE (([TABLE1].USER)="JOHNSMITH")
UNION ALL SELECT Count(*) AS SubCount
FROM [TABLE2]
WHERE (([TABLE2].USER)="EJONES");
The results are:
SubCount
--------------
380
45
But, as I mentioned, from with the same query I want the following:
SubCount
--------------
425
Any ideas?
Thanks in Advance!