counting yes/no

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

Guest

Can anyone tell me how to count the number of times a yes is recorded in a
yes/no field Thanks
 
Using a query

SELECT Count(TableName.FieldName) AS CountOfFieldName
FROM TableName
GROUP BY TableName.FieldName
HAVING TableName.FieldName=True

Or, using Dcount
=Dcount("FieldName","TableName","FieldName = True")
 
Thank you fredg. Worked like a charm, sorry ofer I did it that way and it
would not work.

fredg said:
Can anyone tell me how to count the number of times a yes is recorded in a
yes/no field Thanks

=ABS(Sum([Yes/NoFieldName]))
 
=Dcount("FieldName","TableName","FieldName = True")

If you write the above in the control source of a field in the report, you
need to change the FieldName to the Yes/No field name in the table, and the
tableName to the name of your table.


--
The next line is only relevant to Microsoft''s web-based interface users.
If I answered your question, please mark it as an answer. It''s useful to
know that my answer was helpful
HTH, good luck


Akrt48 said:
I am having trouble with it, I am trying the DCount as its a report based on
a query. When you say dcount(" do you mean dcount([fieldname or really
dcount("fieldname because it does not want to work either way I get error.
I know I am being obtuse but can't figure it. Thanks for answering the first
time.

Ofer said:
Using a query

SELECT Count(TableName.FieldName) AS CountOfFieldName
FROM TableName
GROUP BY TableName.FieldName
HAVING TableName.FieldName=True

Or, using Dcount
=Dcount("FieldName","TableName","FieldName = True")

--
The next line is only relevant to Microsoft''s web-based interface users.
If I answered your question, please mark it as an answer. It''s useful to
know that my answer was helpful
HTH, good luck
 
I am having trouble with it, I am trying the DCount as its a report based on
a query. When you say dcount(" do you mean dcount([fieldname or really
dcount("fieldname because it does not want to work either way I get error.
I know I am being obtuse but can't figure it. Thanks for answering the first
time.
 

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