This function in SQL Server is used to sum up a time or a date interval to a specified date, then returns the modified date.
- This function is used to sum up a time or a date interval to a date specified.
- This function comes under Date Functions.
- This function accepts three parameters namely interval, number and date.
- This function can also include time in the interval section.
DATEADD(interval, number, date)
Parameter : This method accepts three parameters as given below as follows.
- interval – It is the specified time or date interval which is to be added.
- number – It is the number of interval which is to be added to the date specified. It can be positive, in order to get the dates of the future or it can be negative also, in order to get the dates in the past.
- date – It is the specified date which is to be altered.
Returns : It returns a modified date after adding a date or time interval to the stated date.