Results 1 to 3 of 3
  1. #1
    ermcc is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    6

    Delete duplicate records in another table

    Hi all. Thanks in advance for your help.
    I have two tables that have duplicate order numbers. I would like to compare the first table with the second and then delete the records from the second that match.
    Can I set this up in a macro and run it every day?



    Thanks,
    ermcc
    Last edited by June7; 04-12-2012 at 11:32 AM. Reason: change to more informative title

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    50,423
    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
    tanvi is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    100
    Quote Originally Posted by ermcc View Post
    Hi all. Thanks in advance for your help.
    I have two tables that have duplicate order numbers. I would like to compare the first table with the second and then delete the records from the second that match.
    Can I set this up in a macro and run it every day?

    Thanks,
    ermcc
    This one is best:
    http://www.pcreview.co.uk/forums/del...-t1164753.html

    or you can also use following query:

    Lets assume that you have one table name table1 and another table named table2:

    DELETE FROM table1 WHERE column1 IN (SELECT column1 FROM table2)

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

Similar Threads

  1. Hope NOT to get in trouble here
    By djclntn in forum Forms
    Replies: 12
    Last Post: 03-06-2012, 02:36 PM
  2. Replies: 0
    Last Post: 03-29-2011, 09:37 AM
  3. Simple forms/queries question (I hope!)
    By Remster in forum Access
    Replies: 6
    Last Post: 09-07-2010, 12:08 PM
  4. Simple Question...I hope
    By AndrewCoy in forum Access
    Replies: 1
    Last Post: 07-18-2010, 10:06 AM
  5. simple linking question I hope
    By wing8lc in forum Queries
    Replies: 4
    Last Post: 01-21-2010, 03:13 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