Results 1 to 7 of 7
  1. #1
    Dick60 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    6

    delete query

    I have 2 tables, a source table called 1 and a table called 2 with wrong entries from the source table. I already created that query to select the wrong entries from 1 en copy them into 2. Now I want a delete query that removes the entries from table 2 from table 1.

    Pls. give me some help. I am using Access 2010

    best regards
    DB

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Can you post the SQL code of your query that selects the wrong entries?
    What we really need to know is that is the unique connection between the two fields.

  3. #3
    Dick60 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    6
    it is the Name of an instrument. sometimes tags typed wrong and I want the removed from table 1 after copy the into table 2.

  4. #4
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    The structure would look something like this:
    Code:
    DELETE [Table1].*
    FROM Table1
    WHERE [Table1].[Name] IN
    (SELECT [Table2].[Name]
    FROM [Table2]);

  5. #5
    Dick60 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    6
    thank you At the moment I am testing it. I let you know.

  6. #6
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Just be sure to make backup copies of your databases or tables before you start deleting stuff!

  7. #7
    Dick60 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2014
    Posts
    6
    JoeM thanks for the help, you helped me a lot. IT WORKS!!!

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

Similar Threads

  1. Delete query
    By AlexSalvadori in forum Queries
    Replies: 2
    Last Post: 11-16-2012, 11:09 AM
  2. Help with DELETE QUERY
    By taimysho0 in forum Programming
    Replies: 2
    Last Post: 07-12-2012, 06:16 AM
  3. Replies: 2
    Last Post: 01-24-2012, 02:16 PM
  4. Trying to Delete record using delete query
    By MooseOTL in forum Access
    Replies: 13
    Last Post: 10-04-2011, 02:30 AM
  5. Replies: 11
    Last Post: 03-30-2011, 01:08 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