Access 2007 syntax

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

Guest

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?
 
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
 

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