Results 1 to 4 of 4
  1. #1
    JamiB1979 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2011
    Posts
    4

    Issue with Counts of Checkboxes in Query

    Hello All! I am needing a push in the right direction. A little background for my question.

    I have this table and it deals with quality assurance. There are five questions that the QA department asks the caller. The answers are represented by checkboxes. I think there are 13 total checkboxes. A couple questions have three answers.

    I need a summary report for a given time frame. That will have the company the caller works for, and a percentage for each answer to each question. I know how to get a time frame. That's easy. I know how to group by company. Again simple. I know how to use count functions but im stumped on how to do the counts on this. Here is what I was thinking. I need to almost run a query for each answer and do something like

    select count(answercheckbox as count of answercheckbox)
    from table


    where checkbox = 1

    What does everyone think?

    Thanks all!

    Jamie

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    First, I presume the fields are Yes/No datatype. These fields hold either -1 for True/Yes or 0 for False/No. You could Sum the field but then have to deal with negative sign.

    Ideally for ease of query, the table would be structured like: CompanyID QuestionID AnswerCheck (is this how you have it?), then query could be:
    SELECT CompanyID, QuestionID, Count(AnswerCheck) AS CountOfAnswer
    FROM table
    WHERE AnswerCheck=True;
    GROUP BY CompanyID, QuestionID

    Instead of the GROUP BY query, try building a report and use its Grouping & Sorting with summary calcs features.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    JamiB1979 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2011
    Posts
    4

    Smile Checkbox Totals

    Excellent! Thanks so much for the thought! I got the query below to work for one of the questions. I'll just create a query for each question like this.

    Next question to this. I would now need to count up the checkboxes and divide it by the total amount of calls to get a percent. I would really like to get a running total with each query and then just use that running total field on the report. Is that at all possible with Access? I could always do another query where I sum up the counts. Is that a possible solution?


    Thanks so very much for the help so far!!


    Jamie

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    I would have to work with the data to be sure what you could accomplish. Seems that report Grouping & Sorting should be able to present the data in almost any grouping you want without having to save multiple queries. And if you want all the questions on one report, multiple queries will be quite unwieldy. Reports can do aggregate calcs (sum, avg, count) in the group, page, report header/footer.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Counts & Calcuations in Select Query
    By BLD21 in forum Queries
    Replies: 4
    Last Post: 04-08-2011, 11:29 AM
  2. Replies: 4
    Last Post: 10-01-2010, 12:06 PM
  3. Replies: 23
    Last Post: 06-30-2010, 02:05 PM
  4. Reporting counts in another query...maybe?
    By Geewaagh in forum Queries
    Replies: 7
    Last Post: 06-04-2010, 07:39 PM
  5. Missing Counts that = 0 in query results
    By dandhjohn in forum Queries
    Replies: 1
    Last Post: 01-29-2010, 11:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums