How automatically add 1 year date to an existing date in SQL Server

后端 未结 3 1128
抹茶落季
抹茶落季 2021-01-18 12:16

I have a task to automatically bill all registered patients in PatientsInfo table an Annual Bill of N2,500 base on the DateCreated column.

<
3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-18 12:47

    Use DATEADD, i.e.:

    SELECT DATEADD(year, 1, '2006-08-30')
    

    Ref.: http://msdn.microsoft.com/en-us/library/ms186819.aspx

提交回复
热议问题