View Single Post
  #3  
Old May 10th, 2010, 07:51 PM posted to microsoft.public.access.queries
SITCFanTN
external usenet poster
 
Posts: 49
Default Delete Records from Table using Query Results

Hi John,

When I use the delete query you gave me, all the records I have in table
named "Records" are deleted. I just need the records deleted that contains a
duplicate "Customer Number" in the table "Records" and that also appear in
table "Transfer". Do you have any idea what I could be doing wrong. I'm
using exactly what you gave me below. As always I appreciate your help,
thank you.

"John Spencer" wrote:

Use a delete query

DELETE
FROM Records
WHERE [Customer Number] in
(SELECT [Customer Number] FROM Transfer)

In query design view
== Add the table Records
== Select the customer number into the list of fields
== Select Query: Delete from the menu
== Enter the criteria under the customer number field
in (SELECT [Customer Number] FROM Transfer)

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

SITCFanTN wrote:
I have a table named "Records" that contains a field "Customer Number". I
need to delete all the records in table "Records" if the "Customer Number" is
also in the table named "Transfer". Is there a simple way to accomplish
this? Thank you!

.