Using Count() on Reports

T

Terry

David,

There are two ways you could approach this. Either create
a totals query and base your report on this or create a
straight select query and group in your report.

I prefer the second approach as the query can be re-used
if you want additional detail at a later date. I suspect
the totals you want are grouped from various fields in
your database - PC manufacturer, Active/inactive etc. If
you want to total by the smallest amount - eg compaq, NT
inactive - I would create a field in your query which
concatenates all the variables -
eg grouping: [manufacturer]&[active]&[operatingsystem].
This will enable all permutations to be totalled.
In your report group by this "grouping" field and include
a group header and footer. The detail section can be
shrunk to nothing. In the header put a control for the
heading (something like ="Number of pcs from "&
[manufacturer]&" that are running "&[operatingsystem]) and
in the footer a control with =count([grouping]). The
inactive / active part of your heading may need a bit of
massaging such as iif([active]=true,"active","inactive").

This will give you the counts for all the different
occurances.

HTH,

Terry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top