Description
Document TIMESTAMPADD, TIMESTAMPDIFF functions.
(Initial request was to add DATEADD as built-in scalar function, as follows. But it turns out that TIMESTAMPADD is similar enough.)
Syntax: DATEADD (datepart , number , date )
Arguments:
- datepart - Is the part of date to which an integer number is added.
- number - Is an expression that can be resolved to an int that is added to a datepart of date
- date - Is an expression that can be resolved to a time.
Example
SELECT DATEADD(month, 1, '2017-05-31') from tab;
returns 2017-06-30 00:00:00.000
MSSQL: https://docs.microsoft.com/en-us/sql/t-sql/functions/dateadd-transact-sql
MySql: https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_date-add