Delete query

Magster

Registered User.
Local time
Today, 02:50
Joined
Jul 30, 2008
Messages
115
Hi all,

I totally give up on this one - but I guess not totally. I could do this with a recordset in VBA, but I'd really like to accomplish this via stored query.

I have one table that consists of one column which is a Long Int field and I store a key value in it - call it tblTemp. This table has no relationship with another other table.

I want to use tblTemp to find matches in another table called tblClients and delete the matches.

If someone could paste the sql code from the query builder I would be eternally grateful.

Queries are not my strong suit~ Thanks!
 
Presumably you've tried the obvious: a query with tblTemp's only field and linking it to the target field in the other table?
 
Yes, I tried that and it didn't work, but I just found an answer on another site:

DELETE FROM tableA
WHERE tableA.ID IN (SELECT DISTINCT ID FROM tableB)

This works great... I forgot about the inbedded select statement for the matches...

Thanks for reading!:D
 

Users who are viewing this thread

Back
Top Bottom