select xfsj = '2008-04-14 ' + convert(varchar,xfsj,114) from tabupdate ta set xfsj = '2008-04-14 ' + convert(varchar,xfsj,114)

解决方案 »

  1.   

    select dateadd(d, datediff(d, '2015-10-02 20:23:00.000', '2008-4-14') ,'2015-10-02 20:23:00.000')/*
    -----------------------
    2008-04-14 20:23:00.000(1 row(s) affected)*/
      

  2.   

    Select xfsj='2008-04-14'+right(xfsj,13) from tb
      

  3.   

    update tb
    Set xfsj='2008-04-14'+right(convert(char(23),xfsj,114),13)xfsj为datetime类型
      

  4.   


    update table set xfsj = dateadd(d, datediff(d, xfsj , '2008-4-14') ,xfsj)这个方法,我个人比较喜欢。
      

  5.   

    update tb
    Set xfsj=cast('2008-04-14'+right(convert(char(23),xfsj,114),13) as datetime)
      

  6.   


    update tb set xfsj = '2008-04-14 ' + convert(varchar(8),xfsj,114)
      

  7.   

    update tb set xfsj = '2008-04-14 ' + convert(varchar(8),xfsj,114)
    where convert(char(10),xfsj,120) <> '2008-04-14'
      

  8.   


    UPDATE TbTemp SET xfsj = DATEADD(DAY,DATEDIFF(DAY,xfsj,'2008-4-14'),xfsj)
      

  9.   

    declare @date varchar(20)
    set @date ='2008-04-16 '
    select @date + convert(varchar,CreateTime,114) datetime
    from
    dbresult.dbo.TB_PASSSUPERTRANdatetime                                           
    -------------------------------------------------- 
    2008-04-16 20:23:51:417
    2008-04-16 22:54:15:767
    2008-04-16 00:08:51:317
    2008-04-16 14:33:41:897
    2008-04-16 14:35:01:600
    2008-04-16 14:35:01:600