How to count a field

G

Guest

If for example, I have a table that contains a column with values of 0, 1 or
2. How can I count how many records contain 0 in that field . . . how many
contain 1 on that field . . . etc?
 
G

Guest

Try this:

=Sum(Iif([MyFieldName] = 0, 1, 0) ' How many has a 0
=Sum(Iif([MyFieldName] = 1, 1, 0) ' How many has a 1
=Sum(Iif([MyFieldName] = 2, 1, 0) ' How many has a 2

Change MyFieldName for the name of your field

Mauricio Silva
 

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