PC Review


Reply
Thread Tools Rate Thread

Deleting records based on records in another table

 
 
Paul Fenton
Guest
Posts: n/a
 
      22nd Aug 2003
I have 2 tables, A & B, the records for which come from 2 separate
queries that created the tables. Now I want to delete from table B,
all the records contained in table A.

I need some help with a query or VBA that will accomplish this. Both
tables contain an ID field that is unique and not duplicated. So if a
record in A with ID 03124 exists in Table B, I want to delete that
record from table B.


Paul Fenton
 
Reply With Quote
 
 
 
 
John Spencer (MVP)
Guest
Posts: n/a
 
      23rd Aug 2003
That should be fairly simple.

Delete TableB.*
FROM TableB INNER JOIN TableA
ON TableB.IDField = TableA.IDField

Are you sure this isn't homework. It seems pretty simple and straightforward.


Paul Fenton wrote:
>
> I have 2 tables, A & B, the records for which come from 2 separate
> queries that created the tables. Now I want to delete from table B,
> all the records contained in table A.
>
> I need some help with a query or VBA that will accomplish this. Both
> tables contain an ID field that is unique and not duplicated. So if a
> record in A with ID 03124 exists in Table B, I want to delete that
> record from table B.
>
> Paul Fenton

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
recursively retrieve records from 2nd table based on records from elsamiro2351 Microsoft Access Queries 1 9th Mar 2010 12:03 PM
Need to update records in a table based upon records in another ta Iram Microsoft Access Queries 2 17th Dec 2009 12:25 AM
Deleting records based on another table Rockn Microsoft Access Form Coding 1 2nd Feb 2009 11:50 PM
Deleting records in a table based on criteria =?Utf-8?B?SmFjayBGbGVldA==?= Microsoft Access 1 25th Feb 2007 03:31 AM
Update records based on value of other records in same table =?Utf-8?B?U3RldmUgUw==?= Microsoft Access Queries 2 21st Feb 2007 07:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:24 PM.