How to: |
Reference: |
Given a date in standard date or date-time format, DTADD returns a new date after adding the specified number of a supported component. The returned date format is the same as the input date format.
DTADD(date, component, increment)
where:
Date or date-time
Is the date or date-time value to be incremented, which must provide a full component date.
Keyword
Is the component to be incremented. Valid components (and acceptable values) are:
Integer
Is the value (positive or negative) to add to the component.
The following request against the WF_RETAIL data source adds three days to the employee date of birth:
DEFINE FILE WF_RETAIL NEWDATE/YYMD = DTADD(DATE_OF_BIRTH, DAY, 3); MGR/A3 = DIGITS(ID_MANAGER, 3); END TABLE FILE WF_RETAIL SUM MGR NOPRINT DATE_OF_BIRTH NEWDATE BY MGR ON TABLE SET PAGE NOPAGE END
The output is: