Access 2007 syntax

T

tammy

I have a with field with yes/no values and need to count the number of "Y"
(yes)responses on a report. What syntax/code can I use to count only the Y
values?
 
D

Douglas J. Steele

You can use the DCount Domain Aggregate function:

DCount("*", "[NameOfTable]", "[NameOfYesNoField] = True")

You can also use SQL:

SELECT Count(*) AS TotalYes
FROM NameOfTable
WHERE NameOfYesNoField = True
 
Top