How to: |
The AYM function adds months to or subtracts months from a date in year-month format. If necessary, you can convert a date to year-moth format using the CHGDAT or EDIT function.
AYM(indate, months, output_format)
where:
I4, I4YM, I6 or I6YYM
Is the legacy date in integer year-month format. If the date is not valid, the function returns a 0.
Integer
Is the number of months you are adding to or subtracting from the date. To subtract months, use a negative number.
I4YM or I6YYM
Is the resulting legacy date.
Tip: If the input date is in integer year-month-day format (I6YMD or I8YYMD), divide the date by 100 to convert to year-month format and set the result to an integer. This drops the day portion of the date.
AYM adds six months to HIRE_MONTH and stores the result in a column with the format I4YM.
AYM(HIRE_MONTH, 6, 'I4YM')
For 99/04, the result is 99/10.
For 98/11, the result is 99/05.
iWay Software |