How to: |
The DATEMOV function moves a date to a significant point on the calendar.
Since Dialogue Manager interprets a date as alphanumeric or numeric, and DATEMOV requires a standard date stored as an offset from the base date, do not use DATEMOV with Dialogue Manager unless you first convert the variable used as the input date to an offset from the base date.
DATEMOV works only with full component dates.
DATEMOV(date, 'move-point')
where:
Date
Is the date to be moved. It must be a full component format date (for example, MDYY or YYJUL).
Alphanumeric
Is the significant point the date is moved to enclosed in single quotation marks. An invalid point results in a return code of zero. Valid values are:
EOM is the end of month.
BOM is the beginning of month.
EOQ is the end of quarter.
BOQ is the beginning of quarter.
EOY is the end of year.
BOY is the beginning of year.
EOW is the end of week.
BOW is the beginning of week.
NWD is the next weekday.
NBD is the next business day.
PWD is the prior weekday.
PBD is the prior business day.
WD- is a weekday or earlier.
BD- is a business day or earlier.
WD+ is a weekday or later.
BD+ is a business day or later.
A business day calculation is affected by the BUSDAYS and HDAY parameter settings.
Note: DATEMOV 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 an integer field.
This example finds the end day of the current date week
DATEDIF('&YYMD', 'EOW')
and returns 20040326 if today is 2004, March 23rd. Note the use of the system variable &YYMD and natural date representation in the first argument.
iWay Software |