怎么是这样写的啊update table set yourfield =
你的年月日 + substring(convert(char(8),yourfield ,112),8,最后) where
substring(convert(char(8),yourfield ,112),1,4)= 2004可能 substring 的取数不对,自己调试一下
你的年月日 + substring(convert(char(8),yourfield ,112),8,最后) where
substring(convert(char(8),yourfield ,112),1,4)= 2004可能 substring 的取数不对,自己调试一下
set colname = '2003-01-01'+substring(convert(char(8),column,120),12,8)
where ....
set column=dateadd(year,2004-year(column),column)
declare @Ddate datetime --表示要替换成的目标年份
update table
set field1=dateadd(yy,@ddate-year(field1),field1)
where .....