Results 1 to 4 of 4
  1. #1
    carlym is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Posts
    2

    Need help with join types, getting duplicate results

    Please be patient with me as I am a newbie. I have four separate queries, all exactly the same layout. When I join them I am getting a cartesian error which duplicates entries in my query results for the first of the 4 queries that are joined. (NO, my tables do not have duplicate entries in them, however they do all share the same vendor names which appear multiple times in some tables. ) I have each table joined by the "Vendor Name", which is a lookup field in each table. My table "Active Vendors" is the source from which the lookup field gets it's info. Because each individual table may have multiple entries for the same [Vendor Name], when I run my query, query results in columns for [1q13] are correct, but query results in columns for [4q12] are duplicating by the exact number of entries in [1q13] for that particular vendor. (See attached picture) I suspect this will also occur when I begin entering info in the tables for 2q13 and 3q13. I am certain that this is simply the result of an incorrect join, but I have no idea how to format the join so that duplicate entries do not appear. Any assistance is greatly appreciated. Here is my sql for the joined queries.

    SELECT [Active Vendors].VendDBA, [4Q12 fiscal vendor analysis query].[SumOfQuarterly Volume], [4Q12 fiscal vendor analysis query].SumOfNetQtrlyRebate, [4Q12 fiscal vendor analysis query].[SumOfAnnual Rebate Amount], [1q13 fiscal vendor analysis query].[SumOfQuarterly Volume], [1q13 fiscal vendor analysis query].SumOfNetQtrlyRebate, [1q13 fiscal vendor analysis query].[SumOfAnnual Rebate Amount], [2q13 fiscal vendor analysis query].[SumOfQuarterly Volume], [2q13 fiscal vendor analysis query].SumOfNetQtrlyRebate, [2q13 fiscal vendor analysis query].[SumOfAnnual Rebate Amount], [3q13 fiscal vendor analysis query].[SumOfQuarterly Volume], [3q13 fiscal vendor analysis query].SumOfNetQtrlyRebate, [3q13 fiscal vendor analysis query].[SumOfAnnual Rebate Amount]


    FROM ((([Active Vendors] LEFT JOIN [4Q12 fiscal vendor analysis query] ON [Active Vendors].VendDBA = [4Q12 fiscal vendor analysis query].VendDBA) LEFT JOIN [1q13 fiscal vendor analysis query] ON [Active Vendors].VendDBA = [1q13 fiscal vendor analysis query].VendDBA) LEFT JOIN [2q13 fiscal vendor analysis query] ON [Active Vendors].VendDBA = [2q13 fiscal vendor analysis query].VendDBA) LEFT JOIN [3q13 fiscal vendor analysis query] ON [Active Vendors].VendDBA = [3q13 fiscal vendor analysis query].VendDBA;

    I am not an advanced user by any means so if you reply, please try and explain in detail. Thank you in advance!

    Carlym
    Last edited by carlym; 04-26-2013 at 01:27 PM. Reason: added picture

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    'Duplicates' will exist if a table/query is joined to several tables/queries with which there is a 'many' relationship.

    Some data output is often best done on a report/subreport arrangement.
    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
    carlym is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Posts
    2
    Quote Originally Posted by June7 View Post
    'Duplicates' will exist if a table/query is joined to several tables/queries with which there is a 'many' relationship.

    Some data output is often best done on a report/subreport arrangement.
    Thank you for your reply, however, when I generate a report, the report simply duplicates the query and I still end up with the same duplicated records that appeared in the query.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Don't use that same all-in-one query for the report. Build report/subreport(s). Main report bound to parent table and subreports hold related child table records.
    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. Eliminate Duplicate (mirrored) Results
    By fauowls in forum Access
    Replies: 3
    Last Post: 03-21-2013, 03:39 PM
  2. Replies: 8
    Last Post: 09-26-2012, 01:51 PM
  3. Replies: 7
    Last Post: 10-25-2011, 08:32 PM
  4. Query Brings back duplicate results
    By DaveyJ in forum Queries
    Replies: 1
    Last Post: 06-10-2010, 05:59 PM
  5. Suppressing duplicate results
    By jonesy29847 in forum Reports
    Replies: 5
    Last Post: 04-22-2010, 12:43 PM

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