Results 1 to 3 of 3
  1. #1
    VictoriaAlbert is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    16

    Count responses based on entires of other table

    Hello hello -


    I want to do a query that counts the responses in one table that match the values of another table. So, for example

    Table Options
    Blue
    Green
    Red

    Table Responses
    OrderNum Color
    12 Blue
    21 Blue
    33 Red

    So, I want a query that outputs:
    Blue 2
    Green 0
    Red 1

    Any insight would be much appreciated. So far I've only built queries using Query Wizard (so SQL code still reads like Greek to me).

    Thanks.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,942
    This is an aggregate (Totals) query. Build a SELECT query to retrieve the Color field twice then click the Totals button (Sigma symbol) on the ribbon. On the Total row under each Color field select GROUP BY for one and COUNT for the other. Access Help has more guidelines.
    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
    VictoriaAlbert is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    16
    This was a good start. To get the query to work, though, I had to link the tables and change the link properties to show All the data from the Table with the options.

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

Similar Threads

  1. Report from survey responses
    By Saramj in forum Reports
    Replies: 0
    Last Post: 02-20-2011, 04:59 PM
  2. Count IIf based on records above and below
    By William McKinley in forum Queries
    Replies: 19
    Last Post: 09-17-2010, 04:49 PM
  3. Delete empty entires
    By justinwright in forum Queries
    Replies: 3
    Last Post: 07-22-2010, 11:27 AM
  4. Conditional Responses in Form
    By jheintz57 in forum Forms
    Replies: 7
    Last Post: 03-31-2010, 09:57 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