count if checked

R

Randal

I have a couple dozen check boxes in a table that I need to count. I am
looking for a way to use a single query to display a count per field only
when that field is checked.
 
M

[MVP] S. Clark

I think you may want to read the following article before you go any
further...

http://advisor.com/Article/clars05

Select Count(*) from table where CheckBoxFieldName

--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
D

Dale Fye

Randal,

I'll assume that each of these checkboxes is in actuality a separate
column in your database (although this is normally bad data
structure).

SELECT Sum(Abs([chk1])) AS SumOfChk1, Sum(Abs([chk2])) AS SumOfChk2
FROM tbl_Checkboxes;



--
HTH

Dale Fye


I have a couple dozen check boxes in a table that I need to count. I
am
looking for a way to use a single query to display a count per field
only
when that field is checked.
 

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