Hi all,
I have just written a sql statement where I want two fields updated
from another table. The statement like so:
update kpidmatter
set clientcode,clientname = (select clientcode, clientname
from clientconversion
where (clientcode = kpidmatter.clintcode))
where exists
(select clientcode, clientname
from clientconversion
where (clientcode = kpidmatter.clintcode))
This refuses to work.
The statement I based this on worked (below) but only updated one
field (teach me for being too ambitions!). Can anyone see anything
obvious? I know that a DDL and sample data is far more useful but in
this case I think there's a simple syntax problem.
I'd be most grateful if someone could spot my error.
Sam
Working sample:
UPDATE kpidmatter
SET clientpartner = (SELECT ContactName
FROM newnames
WHERE (feeearnercode = kpidmatter.clientpartnercode))
where exists
(SELECT ContactName
FROM newnames
WHERE (feeearnercode = kpidmatter.clientpartnercode))