Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / April 2008

Tip: Looking for answers? Try searching our database.

Checkbox qry into Report

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CD27 - 23 Apr 2008 20:14 GMT
Hello group,
I need help on the following. I have a table with 8 different columns
all of them are checkbox options (e.g. yes or no).  I need to run a
report which sums the yes and no.

So it would look something like:

JOB TITLE
Yes XXXX number
No  XXXX number

JOB TITLE 2
Yes XXXX number
No  XXXX number

JOB TITLE 3
Yes XXXX number
No  XXXX number

So far, I create a crosstab qry but can only do one field at a time

TRANSFORM Count(CF.[JOB TITLE]) AS [CountOfJOB TITLE]
SELECT CF.[JOB TITLE]
FROM CF
GROUP BY CF.[JOB TITLE]
PIVOT CF.[JOB TITLE];

How can I create a qry that takes all of the fields into
consideration, so I can make a report off of it.

Thanks
Evi - 23 Apr 2008 20:21 GMT
You can add the yes/no fields in your query
CountYes: Abs([Field1]=True) + Abs([Field2]=True) + Abs([Field3]=True) etc
Then
CountNo: Abs([Field1]=False) + Abs([Field2]=False + Abs([Field3]=False)

> Hello group,
> I need help on the following. I have a table with 8 different columns
[quoted text clipped - 27 lines]
>
> Thanks
Marshall Barton - 23 Apr 2008 20:58 GMT
>I need help on the following. I have a table with 8 different columns
>all of them are checkbox options (e.g. yes or no).  I need to run a
[quoted text clipped - 13 lines]
>Yes XXXX number
>No  XXXX number

[]
>How can I create a qry that takes all of the fields into
>consideration, so I can make a report off of it.

If the check boxes are so closely related that counting the
yeses makes sense, then you have an unnormalized table
structure that will cause more than this on problem.  You
should put that info in a separate table with only one
yes/no field, a foreign key to the main table and a value to
indicate which option was checked.

You current question can be done by using these odd kind of
expressions:

Yes        =-chk1-chk2-chk3- ...
No        =8+chk1+chk2+chk3+ ...

Signature

Marsh
MVP [MS Access]

CD27 - 23 Apr 2008 21:24 GMT
Thanks Evi and Marsh,

You are absolutely right Marsh, this table is not normalized at all
but unfortunately i can not do anything about it since I did not
create it.  Will see how much trouble this will cause later, I'm
assuming a lot though!

> >I need help on the following. I have a table with 8 different columns
> >all of them are checkbox options (e.g. yes or no).  I need to run a
[quoted text clipped - 36 lines]
>
> - Show quoted text -
Marshall Barton - 23 Apr 2008 22:39 GMT
>Thanks Evi and Marsh,
>
>You are absolutely right Marsh, this table is not normalized at all
>but unfortunately i can not do anything about it since I did not
>create it.  Will see how much trouble this will cause later, I'm
>assuming a lot though!

Been there and the pain just keeps coming back  ;-)
My sympathies.

Signature

Marsh
MVP [MS Access]

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.