Report Count Criteria Numbers Multiple

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I would like to count records in a report. Here are two different scenarios
that I am trying to figure out:

1) How to count records with the following criterion: "Fieldname1" = 0 (as
in the number 'zero'). The Fieldname1 is a checkbox.

2) How to count records that meet two criteria: "Fieldname1" = 0 AND
"Fieldname2" = 'aparticulartextphrase'

So far, I can do the following:

DCount("Fieldname2" , "[TableName]", "Fieldname2 = 'aparticulartextphrase'")

This allows me to count records where Fieldname2=aparticulartextphrase.

Thanks,
Diana
 
DCount("Fieldname2" , "[TableName]", "Fieldname1 = 0 AND Fieldname2 =
'aparticulartextphrase'")

although I generally would use

DCount("*" , "[TableName]", "Fieldname1 = 0 AND Fieldname2 =
'aparticulartextphrase'")

The difference is that the DCount function doesn't count records that
contain Null values in the specified. When you use an asterisk, the DCount
function calculates the total number of records, including those that
contain Null fields. In this case, of course, since you're only trying to
count records where Fieldname2 has a specific value, it shouldn't matter.
 

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

Back
Top