help with counting in a column

  • Thread starter Thread starter William
  • Start date Start date
W

William

I have a column in which all the entries are YES or NO. I would like to
count the number of YESs in the column, but can only figure out how to count
the number of entries are in the column. How do I do this?

Thanks,
 
Since no=0 and yes = -1 (in a Boolean field) then,


ABS(SUM(yesNoField ))

returns the number of yes. As exmaple:

-1 + -1 + -1 + 0 + -1 returns -4, so we take the absolute
value, to get, indeed, that there are 4 yes



and


ABS( SUM( yesNoField = 0) )

returns the number of no.




Vanderghast, Access MVP
 
Thanks!
--
William


Michel Walsh said:
Since no=0 and yes = -1 (in a Boolean field) then,


ABS(SUM(yesNoField ))

returns the number of yes. As exmaple:

-1 + -1 + -1 + 0 + -1 returns -4, so we take the absolute
value, to get, indeed, that there are 4 yes



and


ABS( SUM( yesNoField = 0) )

returns the number of no.




Vanderghast, Access MVP
 
Back
Top