Results 1 to 4 of 4
  1. #1
    Gabriel2012 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Nov 2012
    Posts
    31

    Querying multiple queries, returning duplicates

    Good morning, the issue I am faced with is outlined below:



    Query #1 (This is already built and working)
    Employee ID, Period, Totals, Productivity (this is a query because the "productivity" figure is a formula)

    Query #2 (this is already built and working)
    Employee ID, Period, CountOfError

    I need to create a new "Accuracy Query" which pulls the "Totals" amount from Query #1 and the "CountOfError" from Query #2, puts them into a new query, grouped by employee ID and period, and than divides the "CountOfError" by the "Totals" to receive an accuracy rating.

    The issue that I run into is that the Employee Id has multiple entries in both querys, so I receive duplicated results; any ideas? Thank you!

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    In Query 1, is there only 1 record for each combination of employee & period?
    Is the same true for Query 2?


    If the answer is yes to both questions above, create a new query and add both query 1 & query 2. Join the two queries by both Employee ID AND period and then select the fields you want in this new query and add your calculated fields as well.

    If the answer is no to both questions, then you have to create an aggregate query for query 1 (and do the same using query 2) such that you end up with only 1 record per employee/period combination.

    If this does not answer your question, it would be best if you can provide some example data from both your original query 1 & query 2 so that we can see what you data look like.

  3. #3
    Gabriel2012 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Nov 2012
    Posts
    31
    Your solution worked, many thanks!

  4. #4
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You're welcome.

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

Similar Threads

  1. Returning multiple datasets from table in a form
    By need_help12 in forum Forms
    Replies: 3
    Last Post: 04-19-2012, 06:27 AM
  2. Queries not returning data
    By Verso in forum Queries
    Replies: 1
    Last Post: 08-11-2011, 01:46 AM
  3. Replies: 2
    Last Post: 06-01-2011, 08:36 AM
  4. Returning multiple records Isn't what I need
    By frobro390 in forum Queries
    Replies: 6
    Last Post: 09-21-2010, 06:24 PM
  5. Querying Queries for Music School
    By jenny_jumps in forum Queries
    Replies: 0
    Last Post: 01-28-2009, 11:46 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