Name
dateadd — arithmetic add to a date
Synopsis
dateadd
( |
in unit string , |
in number integer , | |
in date datetime
) ; |
Description
dateadd adds a positive or negative quantity of units to a date (in the internal date time format), and returns a new date so formed. The unit is specified as a string and can be one of the following: 'second', 'minute', 'hour', 'day', 'month', or 'year'. Use datestring to convert the result to a human-readable string.
Parameters
unit
String value denoting the unit to use in the addition.
number
Integer number of unit
units to be added.
date
Datetime value to which the number
of unit
s is to be added
Examples
Example24.70.Simple date addition
Add 10 days to 1996.10.10.
SQL> select dateadd ('day', 10, stringdate ('1996.10.10')); callret BINARY _______________________________________________________________________________ 1996-10-20 01:00:00 1 Rows. -- 92 msec.