"update ta set ta.ra=1 from tablename ta" how can pass in Access

L

lll-j

is it can be pass in the Access?
how to change?
thanks!



update ta
set col = t.col
from ta,(select id,max(col) col from tb
group by id) t
where ta.id = t.id
 
M

Michel Walsh

UPDATE ta SET col = DMAX("col" , "tb", "id=" & id )


or (untested)



UPDATE ta INNER JOIN tb ON ta.id=tb.id
SET ta.col = tb.col
WHERE tb.col = ( SELECT MAX(col) FROM tb AS c WHERE c.id = ta.id )



A Jet query implying an aggregate (elsewhere than in a sub-query in the
WHERE clause) is NOT updateable.


Vanderghast, Access MVP
 
Top