Report Count Criteria Numbers Multiple

D

DianaS

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
 
D

Douglas J Steele

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.
 
Top