count two check box fields

G

Guest

Hello I have four fields in a query based on a single table. Two of these
fields are checkboxes called chkSupport and chkDeny. Most records have one of
these two boxes checked. There are a few that are have neither one checked.
There is a third text field EVENT. The fourth field is Item which is an
autonumber field.

Each EVENT may appear once or several times and I would like to group this
field and count the number of times there is a tick mark in one of the
checkboxes. For example EVENT Bike Race appears 30 times with the Support
Box checked 9 times, the Oppose Box checked 17 times and no box checked 4
times. There are 200 such events.

Can someone please show me a way whereby I can generate a report from a
query which groups the EVENT field and shows a count of Support and Deny.
Thanks for your help.

--Elaine
 
G

Guest

Try something like

SELECT TableName.Event, Sum(Abs(nz([chkSupport],0))+Abs(nz([chkDeny],0))) AS
CountOfCheck
FROM TableName
GROUP BY TableName.Event
 
M

Marshall Barton

Elaine said:
Hello I have four fields in a query based on a single table. Two of these
fields are checkboxes called chkSupport and chkDeny. Most records have one of
these two boxes checked. There are a few that are have neither one checked.
There is a third text field EVENT. The fourth field is Item which is an
autonumber field.

Each EVENT may appear once or several times and I would like to group this
field and count the number of times there is a tick mark in one of the
checkboxes. For example EVENT Bike Race appears 30 times with the Support
Box checked 9 times, the Oppose Box checked 17 times and no box checked 4
times. There are 200 such events.

Can someone please show me a way whereby I can generate a report from a
query which groups the EVENT field and shows a count of Support and Deny.
Thanks for your help.


Not sure I followed all that, but try something like:

SELECT T.Event,
Count(IIf(T.chkSupport Or T.chkDeny. 1, Null))
As CountOfEventsChecked
FROM yourtable As T
GROUP BY T.Event

If that can produce the desired data, then the report should
be trivial.
 

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