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].UNIQUEUSER)="JOHNSMITH")
UNION ALL SELECT Count(*) AS SubCount
FROM [MyTable2]
WHERE (([MyTable2].SWCASSIGNEDUSER)="JOHNSMITH");
The results I get are:
SubCount
--------------
380
2
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].UNIQUEUSER)="JOHNSMITH")
UNION ALL SELECT Count(*) AS SubCount
FROM [MyTable2]
WHERE (([MyTable2].SWCASSIGNEDUSER)="JOHNSMITH");
The results I get are:
SubCount
--------------
380
2
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!