|
How to: |
The DATEADD function adds a unit to or subtracts a unit from a full component date format. A unit is one of the following:
Note that when the DATEADD function calculates the next or previous business day or work day, it always starts from a business day or work day. So if the actual day is Saturday or Sunday, and the request wants to calculate the next business day, the function will use Monday as the starting day, not Saturday or Sunday, and will return Tuesday as the next business day. Similarly, when calculating the previous business day, it will use the starting day Friday, and will return Thursday as the previous business day. You can use the DATEMOV function to move the date to the correct type of day before using DATEADD.
DATEADD requires a date to be in date format. Since Dialogue Manager interprets a date as alphanumeric or numeric, and DATEADD requires a standard date stored as an offset from the base date, do not use DATEADD with Dialogue Manager unless you first convert the variable used as the input date to an offset from the base date.
DATEADD(date, 'component', increment)
where:
Date
Is a full component date.
Alphanumeric
Is one of the following enclosed in single quotation marks:
Y indicates a year component.
M indicates a month component.
D indicates a day component.
WD indicates a weekday component.
BD indicates a business day component.
Integer
Is the number of date units added to or subtracted from date. If this number is not a whole unit, it is rounded down to the next largest integer.
Note: DATEADD does not use an output argument. It uses the format of the date argument for the result. As long as the result is a full component date, it can be assigned only to a full component date field or to integer field.
| WebFOCUS | |
|
Feedback |