MSSLQ常用命令

    技术2022-05-20  40

    当前时间

    select 当前日期=convert(varchar(10),getdate(),120)

     

     

    时间加一天

    update Visit set StartTime=DateAdd(d,1,StartTime) where ....

     

    求时间差

    DATEDIFF() 函数返回两个日期之间的天数。

    DATEDIFF(datepart,startdate,enddate)

     

     

    DEMO:SELECT DATEDIFF(day,'2008-12-29','2008-12-30') AS DiffDate

     


    最新回复(0)