DATEADD Function

Returns a new date by adding a specified time interval to an existing date.

Syntax

DATEADD(date-part, number, date)

Parameters

Return Value

A string like "2016-07-23 21:13:23.350", calculated by adding number to the part of date that is specified by date-part.

Example

-- Prints "2016-08-23 00:00:00.000".
PRINT DATEADD('month', 1, '2016-07-23');

-- Prints "2015-01-29 12:41:25.000".
PRINT DATEADD('day', -5, '2015-02-03 12:41:25');

-- Prints "2015-02-05 16:41:25.000".
PRINT DATEADD('hh', 52, '2015-02-03 12:41:25');