Displaying the counts of two separate queries

T

Tergiver

I know I can query for a count like this:
SELECT Count(*) As ReviewCount FROM [Select for Review labels];

Which gives me the number of records in [Select for Review labels], but what
I would like is a query that returns 3 fields: The above, the same thing
using [Select for Print labels] As PrintCount, and Sum(ReviewCount,
PrintCount).

I tried screwing around with some SQL statements, but as I know next to
nothing about SQL statements I've had no luck.
 
T

Tergiver

I've gotten this far:
SELECT "Print" As Report, Count(*) As Labels FROM [Select for Print labels]
UNION ALL
SELECT "Review" As Report, Count(*) As Labels FROM [Select for Review labels]
;
But I can't figure out how to add a Totals row.
 
J

John Spencer

Are [Select for Print Labels] and [Select for Review labels] tables or are
they queries against the same table?

If they are queries against the same table, then perhaps you could run a
query against that table. Also, you may be able to use the DCount function
to acheive your goal. On a form or in a report you could use a control with
its source set to

=DCount("*","[Select for Print Labels]") + DCount("*","[Select for Review
labels]")

You could set other controls for the Print and Review counts.


Tergiver said:
I've gotten this far:
SELECT "Print" As Report, Count(*) As Labels FROM [Select for Print
labels]
UNION ALL
SELECT "Review" As Report, Count(*) As Labels FROM [Select for Review
labels]
;
But I can't figure out how to add a Totals row.

Tergiver said:
I know I can query for a count like this:
SELECT Count(*) As ReviewCount FROM [Select for Review labels];

Which gives me the number of records in [Select for Review labels], but
what
I would like is a query that returns 3 fields: The above, the same thing
using [Select for Print labels] As PrintCount, and Sum(ReviewCount,
PrintCount).

I tried screwing around with some SQL statements, but as I know next to
nothing about SQL statements I've had no luck.
 
Top