Results 1 to 8 of 8
  1. #1
    jamal numan is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113

    Question How to delete the duplicated records in a field?

    How to delete the duplicated records in a field?



    please, see the attached screen shot that shows my question

    Sure, i can find the duplicated values in certain field but what i wanted is to delete these duplicated values!

    is there away to delete these duplicated values in simple way?

    regards

    Jamal

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    If you are able to create a query that FINDS the duplicate values you want to get rid of, then, once you have the query - convert the query to a Delete Query.
    There should be a button in your query window with a X! & 'Delete'.
    Once it is a Delete query - it will delete all the duplicates when you run it.

    Hope this helps!

  3. #3
    jamal numan is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113

    Question

    Quote Originally Posted by Robeen View Post
    If you are able to create a query that FINDS the duplicate values you want to get rid of, then, once you have the query - convert the query to a Delete Query.
    There should be a button in your query window with a X! & 'Delete'.
    Once it is a Delete query - it will delete all the duplicates when you run it.

    Hope this helps!
    Thank you for the reply Robeen.

    i tried to convert the query that specifies the duplicate values into "Delete query" but this action will delete 952 values from the source table! in other words, it will not delete ONLY the duplicate values from the source field

    what might be the problem (the screen shots and the data are attached)?

    regards

    Jamal

  4. #4
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Did you 'Find Duplicates' query find all your duplicate rows?

    I thought I might have given you wrong information so i just tested what I told you to do.

    I added a two duplicate records to one of my tables.
    Now I have three identical records.

    I usd the query wizard to create a FindDuplicates query.
    The query found all three duplicate records.

    When I converted it to a Delete query and ran it, it wanted to delete all three of the identical records.

    I can see right off the bat that I wouldn't necessarily want to delete all three - just two of the three.

    Is that what you need as well?

  5. #5
    jamal numan is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113

    Question

    Quote Originally Posted by Robeen View Post
    Did you 'Find Duplicates' query find all your duplicate rows?

    I thought I might have given you wrong information so i just tested what I told you to do.

    I added a two duplicate records to one of my tables.
    Now I have three identical records.

    I usd the query wizard to create a FindDuplicates query.
    The query found all three duplicate records.

    When I converted it to a Delete query and ran it, it wanted to delete all three of the identical records.

    I can see right off the bat that I wouldn't necessarily want to delete all three - just two of the three.

    Is that what you need as well?

    Sorry for the confusion.
    please, refer to the first screen shot that shows what i have as source table (table10) that contains duplicates and the result that i wish to reach (table11).

    i tried the method that you have described but sounds to delete all the records of the source table

    what might be the problem?

    regards

    Jamal

  6. #6
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Looking at your screenshot1:

    Create a query with SQL like this:
    1. Start Query Design.
    2. Do not select any table - click 'Close'.
    3. On the top left - click 'SQL View'.
    4. Type this in there: Select Distinct [Field1] From Table10.
    5. Run the query.

    Does that give you what you want?

  7. #7
    jamal numan is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113

    Thumbs up

    Quote Originally Posted by Robeen View Post
    Looking at your screenshot1:

    Create a query with SQL like this:
    1. Start Query Design.
    2. Do not select any table - click 'Close'.
    3. On the top left - click 'SQL View'.
    4. Type this in there: Select Distinct [Field1] From Table10.
    5. Run the query.

    Does that give you what you want?
    Perfect! this is what I'm looking for

    Appreciated

    Regards

    Jamal

  8. #8
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Happy to help!!

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

Similar Threads

  1. Delete all records
    By stryder09 in forum Access
    Replies: 6
    Last Post: 05-11-2011, 02:07 PM
  2. Records duplicated based on field
    By dskulman in forum Queries
    Replies: 3
    Last Post: 03-03-2011, 06:26 PM
  3. delete records
    By fiamma68 in forum Queries
    Replies: 0
    Last Post: 11-15-2010, 06:54 PM
  4. Delete all records in a field
    By cotri in forum Forms
    Replies: 6
    Last Post: 01-29-2010, 02:44 PM
  5. #delete records
    By supernova122 in forum Access
    Replies: 0
    Last Post: 07-08-2009, 08:41 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