Results 1 to 5 of 5
  1. #1
    som3on3_10 is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    3

    How to prevent duplicate records when joining two tables

    Hello,



    How do I prevent duplicate records when joining 2 tables in Access? For example if both tables have an "ID" field and Table A has one record with ID 123, but Table B has two records with ID 123. When I join Table A to Table B using a left join, I get 2 records where ID = 123. I only need to retrieve 1 record. Sorry, joining tables is kind of new to me. TIA!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,913
    If these tables have a many-to-1 relationship, that is expected. Why are you joining the tables? Show sample data and expected results. Quite possibly you need to do an aggregate Totals (GROUP BY) query or build a report using Grouping & Sorting 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
    som3on3_10 is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    3
    So are you saying that I should query from Table B and group the ID field which will eliminate the dups and then join Table A with this new 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
    52,913
    That's one way to go.
    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.

  5. #5
    som3on3_10 is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    3
    Cool I will give it a try. Thanks for the help.

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

Similar Threads

  1. How to prevent duplicate records
    By talktime in forum Programming
    Replies: 7
    Last Post: 05-15-2013, 11:02 PM
  2. Prevent duplicate records for calculated field
    By LoveLEE143 in forum Access
    Replies: 3
    Last Post: 05-03-2013, 11:46 AM
  3. Replies: 4
    Last Post: 04-03-2013, 08:49 PM
  4. Replies: 1
    Last Post: 01-04-2012, 01:39 PM
  5. Replies: 2
    Last Post: 02-12-2011, 09:54 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