Negative Number when Counting Yes/No

G

Guest

I have a table that has a lot of number fields and some yes/no fields. I am
doing a query to get averages for the number fields and a count for all the
yes fields. But those fields come up with the right number except they are
negative. There are 32 records in the database and one of the yes/no fields
have 20 yes, but the query gives me -20. How can I change it so that it is a
positive number?
 
G

Guest

Robyn,

Access stores "Yes" responses as True (has a numeric value of -1). To Count
the number of yes values, you can just SUM the absolute value of the field,
something like:

SUM(ABS([FieldName]))

HTH
Dale
 
J

Jason Lepack

ABS(Sum(Fieldname)) would be faster.

Robyn,

Access stores "Yes" responses as True (has a numeric value of -1). To Count
the number of yes values, you can just SUM the absolute value of the field,
something like:

SUM(ABS([FieldName]))

HTH
Dale

--
Email address is not valid.
Please reply to newsgroup only.



Robyn said:
I have a table that has a lot of number fields and some yes/no fields. I am
doing a query to get averages for the number fields and a count for all the
yes fields. But those fields come up with the right number except they are
negative. There are 32 records in the database and one of the yes/no fields
have 20 yes, but the query gives me -20. How can I change it so that it is a
positive number?

- Show quoted text -
 

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