Delete Records from Table INNER JOIN

  • Thread starter Thread starter brittonsm
  • Start date Start date
B

brittonsm

I'm trying to delete records from a table that match records in
another table. - The SELECT query returns the correct records, now I
just to delete them...

DELETE tblFNETBuyer.*
FROM tblFNETBuyer INNER JOIN tblSpendwithPPV ON
tblFNETBuyer.FNET_BUYER = tblSpendwithPPV.[PLANNER NAME];
 
STEP 1: BACKUP your data before attempting the following.
STEP 2: BACKUP your data before attempting the following.

Without a backup you cannot restore the data if this does not work the way you
expect.

SOMETIMES including DISTINCTROW will make this work

DELETE DISTINCTROW tblFNETBuyer.*
FROM tblFNETBuyer INNER JOIN tblSpendwithPPV ON
tblFNETBuyer.FNET_BUYER = tblSpendwithPPV.[PLANNER NAME];

Otherwise the following should always work
DELETE
FROM tblFNETBuyer
WHERE FNET_BUYER in
(SELECT [PLANNER NAME] FROM tblSpendwithPPV)


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
Back
Top