H
Hendy88
Hello,
I have the following SQL that produces two record totals (as it
should). But I want to SUM those two values from within the same
query. Rather than create a second query that SUMs the two values
from the first query:
SELECT Count(*) AS SubCount
FROM [MyTable1]
WHERE (([MyTable1].USER)="JOHNSMITH")
UNION ALL SELECT Count(*) AS SubCount
FROM [MyTable2]
WHERE (([MyTable2].USER)="JOHNSMITH");
The results I get are:
SubCount
--------------
380
45
What I want is:
TotalCount
---------------
425
I've tried "wrapping" that entire SQL code inside of a SELECT SUM,
but
upon execution it says, "this operation is not allowed in
subqueries".
Any ideas?
Thanks in advance!
I have the following SQL that produces two record totals (as it
should). But I want to SUM those two values from within the same
query. Rather than create a second query that SUMs the two values
from the first query:
SELECT Count(*) AS SubCount
FROM [MyTable1]
WHERE (([MyTable1].USER)="JOHNSMITH")
UNION ALL SELECT Count(*) AS SubCount
FROM [MyTable2]
WHERE (([MyTable2].USER)="JOHNSMITH");
The results I get are:
SubCount
--------------
380
45
What I want is:
TotalCount
---------------
425
I've tried "wrapping" that entire SQL code inside of a SELECT SUM,
but
upon execution it says, "this operation is not allowed in
subqueries".
Any ideas?
Thanks in advance!