Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / September 2007

Tip: Looking for answers? Try searching our database.

Access 2007 syntax

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tammy - 13 Sep 2007 16:56 GMT
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?
Signature

Tammy

Douglas J. Steele - 13 Sep 2007 17:03 GMT
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

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.