DATEADD Date Function TSQL Tutorial

Dateadd is an date function and returns a date with the specified number interval added.

DATEADD Syntax:

DATEADD (date_part , number , date )


DATEADD Example:

DECLARE @date datetime = '2014-01-01 13:10:10';
SELECT 'add_year' as Add_year, DATEADD(year,2,@date) as Result;

Add_yearResult
add_year2016-01-01 13:10:10.000

SELECT DATEADD(day, 2, SYSDATETIME()) as Add_day,
DATEADD(month, 2, SYSDATETIME()) as Add_month,
DATEADD(year, 2, SYSDATETIME())as Add_year;

Add_dayAdd_monthAdd_year
2014-02-21 21:52:13.27456892014-04-19 21:52:13.27456892016-02-19 21:52:13.2745689