Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count on Boolean Field

Status
Not open for further replies.

JasonDecHer

Technical User
May 24, 2002
19
US
Hello,
I have one boolean column in a table. I want to run a query that displays in one column the count of true values as well as another column that displays the count of false values. How would I go about doing this with either the access qurey builder or sql syntax?
Thanks,
Jason
 

Not that difficult. In the following query addressofrecord is a Boolean value. To get count of all true items and all false items, use the following and adjust to your needs.

SELECT Sum(IIf([AddressofRecord]=True,1,0)) AS SumTrue, Sum(IIf([AddressofRecord]=False,1,0)) AS SumFalse
FROM dbo_tblClientAdrJunction;
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top