Delete Records from Table INNER JOIN

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];
 
J

John Spencer (MVP)

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top