Re: Error in Delete Query

Tech-Archive recommends: Fix windows errors by optimizing your registry



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]

.



Relevant Pages

  • Re: Corstabquery or normal query
    ... You can create the crosstab similar to the suggestion by John. ... church, also church elders, we have many elders, only 1st elder is one person. ... I would first build a query to get the data ...
    (microsoft.public.access.reports)
  • Re: Creatinig a database to update in alphabetical order
    ... John M. it is like you are reading my mind, ... know I am a movie fanatic. ... > should not be routine) displayed as a query datasheet. ... > Keyword ...
    (microsoft.public.access.gettingstarted)
  • Re: Simply adding two fields
    ... Thank you, John. ... In an update query you update the field to the calculation. ... field before you add it to the master field you will have a problem. ... I'm reading a transaction file of widgets delivered and I want to update ...
    (microsoft.public.access.queries)
  • Re: problem with query
    ... Thanks John, it is not a number field, it is text. ... Open tblSitLog and look at the field SIT - what type of field is ... You may need to write the query as follows ... , tblSITLog.[NATURE OF iNCIDENT] ...
    (microsoft.public.access.queries)
  • Re: set first record to zero in a calculated field
    ... John, after playing around with the FOrmat comand, I think I managed to get ... I resolved it in my previous query by using the Format command in the SQL, ... Center for Health Program Development and Management ...
    (microsoft.public.access.queries)