I have used the syntax because I have several update statement. In that one some are using aggregate functions. Aggregate functions cannot be assigned to a column.
e.g
accdate = (select convert(char, max(ddate), 103)
from @CodeListas s
inner join ddate as r on
r.code = s.Ccode
and @CodeList.Ccode = s.Ccode
where
r.date_type = 'ACF')
It will be great if you can tell me how to modify the update statement with the same logic you mentioned earlier?
|