Counting "Yes" Checkbox Values

G

Guest

I have a table with multiple checkbox fields on it. What I can do is
determine how many checkboxes in each field are True(Yes) and return that
value in a query.

What I need to do, is add the total True(Yes) checkboxes on the table. When
I try to add the returned "count" of True (Yes) it puts the counts
side-by-side. For example, I can return a count of 5, 4, and 2 for three
different fields. When I add them together, I get 542 instead of 11. Any
help?
 
M

MGFoster

Frank said:
I have a table with multiple checkbox fields on it. What I can do is
determine how many checkboxes in each field are True(Yes) and return that
value in a query.

What I need to do, is add the total True(Yes) checkboxes on the table. When
I try to add the returned "count" of True (Yes) it puts the counts
side-by-side. For example, I can return a count of 5, 4, and 2 for three
different fields. When I add them together, I get 542 instead of 11. Any
help?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Looks like you're using the string concatenation operator (&) instead of
the arithmetic operator (+). You'd have to do something like this:

SELECT Abs(SUM(chk1) + Sum(chk2) + Sum(chk3)) as TrueCount
FROM ...

Don't use Count() on a checkbox it will count both the Trues & the
Falses. Sum() will total the values of True (-1). The Abs() function
turns the negative total into a positive.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQvJgY4echKqOuFEgEQKQlQCg0aY8GPyddEkYfV/C0Qbs4jenGvUAoI18
svptE/pPYM3QZemqQq4u2bi1
=3EFB
-----END PGP SIGNATURE-----
 

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