Count Records with Yes/No Value

  • Thread starter Thread starter Linda
  • Start date Start date
L

Linda

I have a User Name field and another field which is Yes/No
and I have a checkmark for the Yes. I want to bring in
only the records that are a yes in a query but I also want
to count the number and give a total at the end of the
report. In the report I don't want to group so do not get
the sum option, and if I put sum in my query instead of
count I get all the records. Please help and thanks.
 
I have a User Name field and another field which is Yes/No
and I have a checkmark for the Yes. I want to bring in
only the records that are a yes in a query but I also want
to count the number and give a total at the end of the
report. In the report I don't want to group so do not get
the sum option, and if I put sum in my query instead of
count I get all the records. Please help and thanks.

To Count checkboxes, use the following expressions:

CountOfYes:ABS(Sum(CheckBoxName]))

CountOfNo:Sum([CheckBoxName]+1)
 
Where do I put this? In the query I have Count so does
this formula go in the report?
-----Original Message-----
I have a User Name field and another field which is Yes/No
and I have a checkmark for the Yes. I want to bring in
only the records that are a yes in a query but I also want
to count the number and give a total at the end of the
report. In the report I don't want to group so do not get
the sum option, and if I put sum in my query instead of
count I get all the records. Please help and thanks.

To Count checkboxes, use the following expressions:

CountOfYes:ABS(Sum(CheckBoxName]))

CountOfNo:Sum([CheckBoxName]+1)
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 
Where do I put this? In the query I have Count so does
this formula go in the report?
-----Original Message-----
I have a User Name field and another field which is Yes/No
and I have a checkmark for the Yes. I want to bring in
only the records that are a yes in a query but I also want
to count the number and give a total at the end of the
report. In the report I don't want to group so do not get
the sum option, and if I put sum in my query instead of
count I get all the records. Please help and thanks.

To Count checkboxes, use the following expressions:

CountOfYes:ABS(Sum(CheckBoxName]))

CountOfNo:Sum([CheckBoxName]+1)
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.

Linda,
"Count" is NOT a good name for a Field Name or a Column Heading in
Access.
See the applicable Microsoft KnowledgeBase article for your version of
Access:
109312 'Reserved Words in Microsoft Access'
209187 'Acc2000: 'Reserved Words in Microsoft Access'
286335 'ACC2002: Reserved Words in Microsoft Access'

If you are doing this in a query, replace the Count Column with some
other name. You can use my suggested name "CountOfYes" or substitute
some other.

YourColumnNameHere:ABS(Sum(CheckBoxName]))

If you are doing this in your report, you would first add an unbound
control to the report.
Set it's control source to:
= ABS(Sum(CheckBoxName]))

Where you place the control depends upon what you are looking for. It
can go in the Report Detail section, a Group Header or Footer, or the
Report Footer (NOT in the Page Footer).

Hope this helps.
 
Back
Top