Updating "Bad" Records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table (tblOne) that has 10 records. I have another table (tblTwo) that has 5 records that are a subset of TblOne. I want to remove the 5 records in TblOne that are NOT in TblTwo. One problem, no unique record identifier(s) in either records that can be combined to distinguish them.

Any suggestions are welcome, thanks.

G
 
How do you identify the 5 "subset" records as being the same as the ones in
the tblOne table?

Assuming that you have three fields in each table (Field1, Field2, Field3)
and when they're the same you don't want to delete the records, a delete
query similar to this might work for you:

DELETE O.* FROM tblOne AS O
LEFT JOIN tblTwo AS T
ON O.Field1 = T.Field1 AND O.Field2 =
T.Field2 AND O.Field3 = T.Field2
WHERE T.Field1 Is Null;

--
Ken Snell
<MS ACCESS MVP>

G said:
I have a table (tblOne) that has 10 records. I have another table
(tblTwo) that has 5 records that are a subset of TblOne. I want to remove
the 5 records in TblOne that are NOT in TblTwo. One problem, no unique
record identifier(s) in either records that can be combined to distinguish
them.
 
Back
Top