Operation must use an updateable query

S

Stapes

Hi

What the four and a half is that about?

This is my query:

UPDATE [LKQRY_LCO-12m] INNER JOIN TM_CompContact ON
[LKQRY_LCO-12m].PK_Contact = TM_CompContact.PK_Contact SET
TM_CompContact.LCO_Due = -1
WHERE (((TM_CompContact.LCO_Due)<>-1));

How do I get this blighter to work?

Stapes
 
K

Ken Snell \(MVP\)

Jet often does not like joined tables in an update query, so the query must
be rewritten to use a subquery:

UPDATE TM_CompContact
SET TM_CompContact.LCO_Due = -1
WHERE TM_CompContact.LCO_Due <> -1 AND
EXISTS
(SELECT [LKQRY_LCO-12m].PK_Contact
FROM [LKQRY_LCO-12m]
WHERE [LKQRY_LCO-12m].PK_Contact =
TM_CompContact.PK_Contact);
 
S

Stapes

Jet often does not like joined tables in an update query, so the query must
be rewritten to use a subquery:

UPDATE TM_CompContact
SET TM_CompContact.LCO_Due = -1
WHERE TM_CompContact.LCO_Due <> -1 AND
EXISTS
(SELECT [LKQRY_LCO-12m].PK_Contact
FROM [LKQRY_LCO-12m]
WHERE [LKQRY_LCO-12m].PK_Contact =
TM_CompContact.PK_Contact);

--

Ken Snell
<MS ACCESS MVP>




What the four and a half is that about?
This is my query:
UPDATE [LKQRY_LCO-12m] INNER JOIN TM_CompContact ON
[LKQRY_LCO-12m].PK_Contact = TM_CompContact.PK_Contact SET
TM_CompContact.LCO_Due = -1
WHERE (((TM_CompContact.LCO_Due)<>-1));
How do I get this blighter to work?
Stapes- Hide quoted text -

- Show quoted text -

Thank you. That eventually worked, after changing it to this:

UPDATE TM_CompContact AS f1 SET f1.LCO_Due = -1
WHERE (((f1.LCO_Due)<>-1) AND ((Exists (SELECT
[LKQRY_LCO-12m].PK_Contact
FROM [LKQRY_LCO-12m]
WHERE [LKQRY_LCO-12m].PK_Contact =
f1.PK_Contact))<>False));

Stapes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top