how do i count "unchecked" boxes

L

lausch1973

I have 2 checkbox fields, [E-Mail] and [Mail]. How do I count the records in
which neither of these fields is checked?
 
D

Duane Hookom

You can try an expression like:
=Sum(Abs( ([Mail] + [E-Mail]) = 0) )
A yes/no field evaluates to either true/-1 or false/0. This allows you to
compare with 0. The Abs() converts true/-1 to 1.
 
C

Clifford Bass

Hi,

Your question is somewhat vague. In your subject line you ask about
counting unchecked boxes. In your message you ask about counting records.

To count the check boxes, use Duane's method. Which from a brilliant
prior post by him can be simplified to:

select Sum(2+[E-Mail]+[Mail]) as Unchecked_Count
from tblYourTable;

To count the records where both the fields are not checked just do a
summary query with the condition of both have to be false.

select Count(*) as Record_Count
from tblYourTable
where [E-Mail] = False and [Mail] = False;

Clifford Bass
 
C

Clifford Bass

Hi,

Oops, misread Duane's response, which counts records--got lost in all
the parantheses!

Clifford Bass
 
C

Clifford Bass

Hi Duane,

Expanding on your idea from a while back, this can be simplified to:

=Sum(1+([Mail] Or [E-Mail]))

Which only uses one function call.

Clifford Bass
 

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