Negative Number when Counting Yes/No

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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
 
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 -
 
Back
Top