The function TIMESTAMPADD returns a new timestamp value based on adding an
interval to an existing timestamp value.
SQL Syntax:
|
|
TIMESTAMPADD (interval, count, timestamp) |
Interval:
|
|
One of the follow constants SQL_TSI_FRAC_SECOND,
SQL_TSI_SECOND, SQL_TSI_MINUTE,
SQL_TSI_HOUR, SQL_TSI_DAY, SQL_TSI_WEEK,
SQL_TSI_MONTH, SQL_TSI_QUARTER, or
SQL_TSI_YEAR
|
Count:
|
|
The count of interval that is added. |
Escape Syntax:
|
|
{fn TIMESTAMPADD (interval, count, timestamp)} |
Return Type:
|
|
TIMESTAMP |
Alternative Function Names:
|
|
DATEADD: This is the equivalent from the MS SQL Server. |
Alternative Interval Names: |
|
Year yy, yyyy
quarter qq, q
Month mm, m
dayofyear dy, y
Day dd, d
Week wk, ww
Hour hh
minute mi, n
second ss, s
millisecond ms |
Examples:
SELECT timestampadd( SQL_TSI_DAY, 21, logdatetime)
from mytable
see also:
SQL Date Time Functions
|