Results 1 to 8 of 8
  1. #1
    puppy26 is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    7

    Deleting Duplications but keeping Original data

    Hi all,
    I would like to execute a code to remove the duplications in the MS Access Query but keeping one one data of the duplications.

    For example, in the below data, I want to check for the data in the column Part No. The part number 123 and 234 are repeated twice so I want to delete the part no 123 and 234 that repeated second time and keeping the one data.

    Please do help me. I'm complete new to MS Access.

    Many thanks!


    Part No Carline Data Call
    123 BMW 1 1
    123 Astra 2 2
    234 Opel 3 4
    235 Volks 4 6
    234 Santro 5 8

  2. #2
    pradeep.sands is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    49
    Hi,
    In the design view,use "DISTINCT" for the Part_No column.
    DISTINCT(Part_No)
    This should work

  3. #3
    puppy26 is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    7
    Hi Pradeep,
    Should I add Distinct(part_no) in the criteria option??

  4. #4
    pradeep.sands is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    49
    Hi,
    I hope you have your table ready. Then create a new QUERY...
    CREATE --> QUERY DESIGN
    Then in the "show table" box, ADD your table.
    Then go to DESIGN--> VIEW --> SQL VIEW
    and there you can write your SQL code and don't forget to add DISTINCT to your PART_No field.

  5. #5
    puppy26 is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    7
    Hi Pradeep,
    If I use Distinct funtion, I'm getting error as Undefined funtion Distinct.. What should I do now!!

    Many thanks for your kind help.

  6. #6
    puppy26 is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    7
    Hi,
    Well, I tried as you mentioned but still getting duplications

    SELECT DISTINCT Catelogue.[Part No], Catelogue.Carline --> still getting duplications.

  7. #7
    pradeep.sands is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    49
    SELECT DISTINCT ([tablename].[part_no])
    is this the way u mentioned?
    and Distinct is not a criteria !!!
    and in your table i see a space between part and no
    try to remove the space and make somethng like "part_no"

  8. #8
    pradeep.sands is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    49
    I guess the Carline, Data and Call have different values for the same 'Part No'.
    So thats the reason it still shows.
    Bcoz the other three colums have different values, access doesn't consider them as duplicates even though part No alone is same.

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

Similar Threads

  1. Deleting Duplication but keeping original
    By puppy26 in forum Access
    Replies: 5
    Last Post: 06-12-2013, 10:29 AM
  2. Replies: 2
    Last Post: 07-25-2012, 01:01 PM
  3. Access Reverts Back to Original Data
    By Howardlr in forum Access
    Replies: 5
    Last Post: 05-24-2012, 08:23 AM
  4. Memo Field Not Keeping Data
    By maintt in forum Forms
    Replies: 1
    Last Post: 08-12-2010, 05:55 PM

Tags for this Thread

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