Re: UPDATE (SQL): multiple SET fields not allowed?

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



"Allen_N" <AllenN@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:042A714E-0E0A-4C4A-8303-57777AA56AEE@xxxxxxxxxxxxx
(My previous reply didn't contain what I typed! Data lost due to
timeout?)

No, I can't see that working. I'm now trying to do it by stepping
through the records of Table1 in a VB loop. What syntax can I use to
change the value of a field in the current record?

"Allen Browne" wrote:

Any chance of using an INNER JOIN between Table1 and Table2?

Join on the 2 fields, and the query should be updatable.

What's wrong with

UPDATE
Table1 a
INNER JOIN
Table2 b
ON
a.Grp1 = b.Grp2old AND a.Item1 = b.Item2old
SET
a.Grp1 = b.Grp2new,
a.Item1 = b.Item2new;

?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.



Relevant Pages