怎么是这样写的啊update table set yourfield = 
你的年月日 + substring(convert(char(8),yourfield ,112),8,最后)  where 
substring(convert(char(8),yourfield ,112),1,4)= 2004可能 substring 的取数不对,自己调试一下

解决方案 »

  1.   

    Update XFMX Set SJ='2004'+Right(convert(varchar(19),SJ,20),15) Where Not SJ IS NULL
      

  2.   

    update table
          set colname = '2003-01-01'+substring(convert(char(8),column,120),12,8)
    where ....
      

  3.   

    直接用日期函数更好。update table
          set  column=dateadd(year,2004-year(column),column)
      

  4.   

    应该直接用日期函数,反正你只要年变,那就直接加上年数不就好了吗?
    declare @Ddate datetime --表示要替换成的目标年份
    update table
          set field1=dateadd(yy,@ddate-year(field1),field1)
    where .....