Results 1 to 6 of 6
  1. #1
    Funky Mayo is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    2

    Removing Duplicate Entries with Multiple Criteria

    Hey, I just started migrating my excel spreadsheet into Access 2016 and I ran into a problem. I want to delete every customer entry besides for the completely unique ones.

    Ex.
    123 K Ave Susy Green
    123 K Ave Susy Green
    123 K Ave Susy Blue
    123 K Ave Fred Blue
    234 L Ave Fred Blue
    234 L Ave Fred Green
    234 L Ave Susy Green



    I want to keep everything here since they are unique data sets except for the second row because it is completely identical to the first row. I've been able to delete if the addresses are identical but how do I filter based on the rest of the criteria as well? I do not want to run multiply queries comparing every possible color and name manually either. I want to have it automatically compare and delete completely identical entries but leave the rest.

    Thanks for the help!

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,535
    Last edited by Bob Fitz; 06-17-2018 at 03:09 AM. Reason: typo
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    Funky Mayo is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    2
    Quote Originally Posted by Bob Fitz View Post
    I tried to specify what I wanted because I don't want what this guide is saying. It ultimately filters so there is only 1 address left of each. I am including people and different things about them as separate entities I don't want to remove.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Post 3 was moderated, I'm posting to trigger email notifications.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,535
    Quote Originally Posted by Funky Mayo View Post
    I tried to specify what I wanted because I don't want what this guide is saying. It ultimately filters so there is only 1 address left of each. I am including people and different things about them as separate entities I don't want to remove.
    If you follow the guide but create a Composite Primary Key that comprises of the three fields you specified in the new blank table, then you should get the desired results
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  6. #6
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,402
    Try this. The table is required to have a primary key autonumber, like Member_PK in the example.

    Click image for larger version. 

Name:	DeleteDupe.JPG 
Views:	15 
Size:	26.9 KB 
ID:	34460
    and the query sql:
    Code:
    DELETE *
    FROM tblMembers AS T1
    WHERE Member_PK <> 
     (SELECT MAX(Member_PK)
     FROM tblMembers AS T2
     WHERE T2.addr = T1.addr AND T2.FirstName = T1.FirstName AND T2.LastName = T1.LastName);

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

Similar Threads

  1. Duplicate entries over multiple fileds
    By Clarkeyboy in forum Access
    Replies: 8
    Last Post: 05-01-2018, 02:22 AM
  2. Replies: 5
    Last Post: 04-15-2016, 08:17 PM
  3. Replies: 11
    Last Post: 03-17-2015, 05:10 PM
  4. Replies: 19
    Last Post: 04-05-2013, 01:28 PM
  5. Replies: 2
    Last Post: 02-28-2013, 10:06 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