yes/no answers to number on report

G

Guest

I have an query with yes/no answers (under each column). When I do up a
report to total each column that I have an yes answer to how do I convert
that yes to a 1 on my report, therefore making me add up the column to give
me a total.

thanks
roger
 
F

fredg

I have an query with yes/no answers (under each column). When I do up a
report to total each column that I have an yes answer to how do I convert
that yes to a 1 on my report, therefore making me add up the column to give
me a total.

thanks
roger

Is the field a CheckBox field?
You don't have to convert the field to a 1.
If the field is a Yes/No datatype, it's values already are either -1
or 0 (numbers).

To count Yes's:
=ABS(Sum([YesNoField))

To count No's:
=Sum([YesNoField]+1)

If the field is a Text datatype field ("Yes" or "No")

To count "Yes":
=Sum(IIf([TextField] = "Yes",1,0))

To count "No":
=Sum(IIf([TextField]="No",1,0))
 
G

Guest

Ok, I now have it set up the on my query that if "yes" it is placed with a -1
and if "No" with a 0. this works great. Now when I am doing my report with I
have summary for each heading. It of course will show the total as a
negative number (i.e. -15). How do I not show this total as not a negative.

thanks
Roger

fredg said:
I have an query with yes/no answers (under each column). When I do up a
report to total each column that I have an yes answer to how do I convert
that yes to a 1 on my report, therefore making me add up the column to give
me a total.

thanks
roger

Is the field a CheckBox field?
You don't have to convert the field to a 1.
If the field is a Yes/No datatype, it's values already are either -1
or 0 (numbers).

To count Yes's:
=ABS(Sum([YesNoField))

To count No's:
=Sum([YesNoField]+1)

If the field is a Text datatype field ("Yes" or "No")

To count "Yes":
=Sum(IIf([TextField] = "Yes",1,0))

To count "No":
=Sum(IIf([TextField]="No",1,0))
 
F

fredg

Ok, I now have it set up the on my query that if "yes" it is placed with a -1
and if "No" with a 0. this works great. Now when I am doing my report with I
have summary for each heading. It of course will show the total as a
negative number (i.e. -15). How do I not show this total as not a negative.

thanks
Roger

fredg said:
I have an query with yes/no answers (under each column). When I do up a
report to total each column that I have an yes answer to how do I convert
that yes to a 1 on my report, therefore making me add up the column to give
me a total.

thanks
roger

Is the field a CheckBox field?
You don't have to convert the field to a 1.
If the field is a Yes/No datatype, it's values already are either -1
or 0 (numbers).

To count Yes's:
=ABS(Sum([YesNoField))

To count No's:
=Sum([YesNoField]+1)

If the field is a Text datatype field ("Yes" or "No")

To count "Yes":
=Sum(IIf([TextField] = "Yes",1,0))

To count "No":
=Sum(IIf([TextField]="No",1,0))

Did you not use =ABS(Sum([YesNoField)) (or any of the other methods I
gave)?
None of them will return a negative number.

In future messages, you might want to take a bit more time when
explaining your problem. Perhaps re-read your message several times
before posting. I found this message rather difficult to understand
(and I'm not sure that I do).
Remember, you know what you mean, but none of us do unless you are
clear in your message.
 

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

Top