Re: Error in Delete Query
- From: djkc <djkc@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 18 Aug 2008 10:11:01 -0700
John,
I tried your SQL Statement in a new query and it is giving me a syntax error
and goes to the
Open Credex
Loans].SSN = [Paid out credex Accts].SSN;
part as where the error is.
"John W. Vinson" wrote:
On Mon, 18 Aug 2008 08:41:00 -0700, djkc <djkc@xxxxxxxxxxxxxxxxxxxxxxxxx>.
wrote:
I made a query to check socials from an active tbl against socials from an
inactive table. I run the query with a left join so that both fields are
equal to show me all the inactive socials that are in the active tbl. I need
these deleted out of the inactive tbl so I change my query type from select
to delete and recieve the error specify the table you want the records to be
deleted from. Anyone know how to get around this?
A DELETE query needs to specify just the table from which you want to delete
records; you can use the * "all fields" option for this purpose. In the query
grid, you can just uncheck the Show checkbox on fields used only for criteria.
Try
DELETE [Paid out credex Accts].*
FROM [Open Credex Loans] INNER JOIN [Paid out credex Accts] ON [Open Credex
Loans].SSN = [Paid out credex Accts].SSN;
to delete all matching records in [Paid out credex Accts] if they have a match
(obviously, change the table name in the DELETE clause if you want to delete
records from [Open Credex Loans], and *MAKE A BACKUP FIRST* just in case!)
--
John W. Vinson [MVP]
- Follow-Ups:
- Re: Error in Delete Query
- From: John W . Vinson
- Re: Error in Delete Query
- References:
- Error in Delete Query
- From: djkc
- Re: Error in Delete Query
- From: John W . Vinson
- Error in Delete Query
- Prev by Date: Re: Query and relationships
- Next by Date: RE: Data type mismatch with crosstab
- Previous by thread: Re: Error in Delete Query
- Next by thread: Re: Error in Delete Query
- Index(es):
Relevant Pages
|