Hi All!
I have a a query the spits out a column populated by either a "YES" or a "NO". How can I total the number of times "YES" appears?
Thanks!
Hi All!
I have a a query the spits out a column populated by either a "YES" or a "NO". How can I total the number of times "YES" appears?
Thanks!
if the yes/no is a Boolean field, you can use a group by query and sum the column*-1 or use the abs function. (Booleans store yes as -1 and no as 0)
if it is a text field then you need to use an iif function and sum that iif(yesnofield="Yes",1,0)
The YES/NO is a short text field. Where in my query do I put the iif function?
Thanks!
your query will be something like
SELECT Sum(iif(yesnofield="Yes",1,0)) as ttlYes
FROM myTable
If you only want it in a text box how about dcount("fieldname",
"queryname,fieldname= "yes")