PC Review


Reply
Thread Tools Rate Thread

Creating delete query based on matching fields between two tables

 
 
DBGuy11
Guest
Posts: n/a
 
      24th Nov 2009
I'm sure there's already one if not several posts for this but I couldn't
any. I have two tables both the same serial code field. I want to a basic
delete from tableA where tableA and tableB have matching serial codes. I have
tried just joining the two table by the serial code field in a delete query
but no matter how I try to go about it nothing works.

Thanks in advance for any assistance you can provide on this issue.

DBGuy11
 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      24th Nov 2009
DELETE FROM tableA
WHERE tableA.SerialCode IN (SELECT DISTINCT SerialCode FROM tableB)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"DBGuy11" <(E-Mail Removed)> wrote in message
news:26CA7107-258F-41DC-97EE-(E-Mail Removed)...
> I'm sure there's already one if not several posts for this but I couldn't
> any. I have two tables both the same serial code field. I want to a basic
> delete from tableA where tableA and tableB have matching serial codes. I
> have
> tried just joining the two table by the serial code field in a delete
> query
> but no matter how I try to go about it nothing works.
>
> Thanks in advance for any assistance you can provide on this issue.
>
> DBGuy11



 
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
Query on two tables with matching null fields tryit Microsoft Access Queries 4 10th Mar 2010 12:16 AM
Delete Query - Delete matching records from 2 tables - Access 2000 Chris Stammers Microsoft Access Queries 4 22nd Jan 2009 02:45 PM
Merging two tables in Dataset? I only want to get the matching info based on the two key fields mike11d11 Microsoft VB .NET 8 9th Dec 2006 02:23 AM
pasting fields in a query based on 2 tables =?Utf-8?B?RGF0YWJhc2UgVXNlcg==?= Microsoft Access External Data 1 23rd Feb 2006 04:19 PM
Pulling data from separate tables based on matching fields junkaccount@derrickcompany.com Microsoft Access 0 6th Dec 2005 07:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:38 PM.