counting yes/no

A

Akrt48

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

Ofer

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")
 
A

Akrt48

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]))
 
O

Ofer

=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
 
A

Akrt48

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.
 
Top