counting multiple fields

J

Janna

I would like a to have a query provide a count for
multiple fields. For example, I have a table with fields
titled SS, CU, NH. Using the count feature in the query
in design view, I can get a record count for each field,
but how do I go about adding them together to get a total
count for all records in all three fields? Thanks much!
 
G

Guest

Janna said:
I would like a to have a query provide a count for
multiple fields. For example, I have a table with fields
titled SS, CU, NH. Using the count feature in the query
in design view, I can get a record count for each field,
but how do I go about adding them together to get a total
count for all records in all three fields? Thanks much!

I'm not sure just what you want. The COUNT operator doesn't count fields, or
values - it counts *records* in the table. If each record in the table has
fields named SS, CU and NH, what exactly are you counting? What are the
values in these fields, and what constitutes a "hit" which you want counted?

John W. Vinson/MVP
 
J

Janna

The value in the field is either "X" or blank. I would
like to obtain a count on the total number of records
that contain "X"

Thanks.
 
J

John Spencer (MVP)

Field: CountSS: Abs(Sum([SS]="X"))

This means that you will need to use a Totals query.

Do you know how to do that?
 
J

Janna

Yep. Thanks!
-----Original Message-----

Field: CountSS: Abs(Sum([SS]="X"))

This means that you will need to use a Totals query.

Do you know how to do that?

The value in the field is either "X" or blank. I would
like to obtain a count on the total number of records
that contain "X"

Thanks.
.
 

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