Skip to content

DATEADD

  • datepart: This parameter identifies the part of the date that the function will modify. It can include values like year, quarter, month, day, etc. It decides which part of the date or time data to add to or subtract from.
  • number: This is the value to be added to the date. It can take a positive or a negative integer, where a positive value increments, a negative value decrements the date value.
  • date: This is the starting date. The function adds or subtracts the value of the ‘number’ parameter from this date. It can be a date or datetime.
SELECT DATEADD(year, 2, '2022-01-01') AS NewDate
NewDate
-------------
2024-01-01

The DATEADD function has been used to add 2 years to a specified date (2022-01-01). The output is a new date (2024-01-01).