Counts by dates

J

John Spencer (MVP)

Vague response to vague question.

Use a UNION ALL query as the source of a Totals (aggregate) query.

or try something like

SELECT Sum(RecordCount) as TotalRecords
FROM (
SELECT Count(*) as RecordCount
FROM TableA
WHERE SomeDate = SomeCriteriaDate
UNION ALL
SELECT Count(*)
FROM TableB
WHERE SomeDate = SomeCriteriaDate
UNION ALL
SELECT Count(*)
FROM TableC
WHERE SomeDate = SomeCriteriaDate)
 
D

Duane Hookom

Why not the same way you would do this with a single query only do it five
or more times?
 
Top