Delete Query

kholm

Registered User.
Local time
Today, 07:54
Joined
Jun 25, 2001
Messages
63
I am creating a delete query that should delete those items which match the first and last name of another table. It looks like this: Field: Last Name, Table: Chi-town, Delete: Where, Criteria: [Delete].[last name]. Same for first name.

When I go to run the query it says to specify the table containing the records you want to delete. I thought I was doing that? Help

Kristin


PS I have posted before, with no avail.
 
Your explanation of what fields you are querying on isn't clear enough for me to understand. Try replying again to this thread with your SQL statement and I (or one of the Access gurus here), can give you more help.
 
He is write, better explain yourself, but...

Delete [Chi-town].*
FROM [Chi-town] INNER JOIN tblYourSecondTable ON [Chi-town].[Last Name]= [tblYourSecondTable].[Last Name];

This is assuming you want to delete all from your table Chi-town where there names are equal from your delete table... Also bud, you should be referencing an ID not a name.... A name can be duplicated, an ID should be unique... This is just advice though....

Hope this helps, good luck....

Regards,
 
The SQL

Here is the SQL, I am still getting the reply "Specify the Table containing the records you want to delete".

DELETE [CHI-TOWN].lastname, [CHI-TOWN].firstname, [CHI-TOWN].address, [CHI-TOWN].city, [CHI-TOWN].state, [CHI-TOWN].zip, [CHI-TOWN].school, [CHI-TOWN].grade
FROM [Take out] INNER JOIN [CHI-TOWN] ON ([Take out].[First Name] = [CHI-TOWN].firstname) AND ([Take out].[Last Name] = [CHI-TOWN].lastname)
WHERE ((([CHI-TOWN].lastname)=[Take out].[Last Name]) AND (([CHI-TOWN].firstname)=[Take Out].[First Name]));
 
I found a way

I found a way around to accomplish what I needed to do. Thank you for all your help.
 
Just a note...

You do not need to specify anything in the where clause if your join works. the join establishes the relationship of name = name.... You need not state it in the where clause as well.....

Regards,
 

Users who are viewing this thread

Back
Top Bottom