Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2008
    Posts
    1

    Unanswered: Delete Duplicate Dates

    Here’s my problem. I have two tables with identical fields. One table (I’ll call it temp) will be imported. The other (call it master) will be updated and filled with an append query from temp.

    For my solution I’ll be looking at a date column called “Pay Dt”. What I want to do is take all of the dates used in the temp column. And delete any rows from the master table that contain a date that is in the temp table. What is the best way to do this?

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    BACKUP ALL DATA FIRST
    Code:
    DELETE FROM masterTable
    WHERE   masterTable.payDate IN (
            SELECT childTable.payDate
            FROM   childTable
          )
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •