How to: |
The HADD function increments a date-time value by a given number of units.
HADD(timestamp, component, increment, length, output_format)
where
Date-Time
Is the timestamp to be incremented.
Alphanumeric
Is the name of the component to be incremented. For a list of valid components, see Date and Time Components For Date and Date-Time Functions.
Integer
Is the number of units, positive or negative, by which to increment the component.
Integer
Is the number of characters returned as the timestamp. Valid values are:
Date-Time
The following example increments thirty months to some specific date-time in the past
HADD(DT(2001/09/11 08:54:34), 'MONTH', 30, 8, 'HYYMDS')
and returns the timestamp 2004/03/11 08:54:34.00.
iWay Software |