How to: |
The YM function calculates the number of months that elapse between two dates. The dates must be in year-month format. You can convert a date to this format by using the CHGDAT or EDIT function.
YM(from_date, to_date, output_format)
where:
I4YM or I6YYM
Is the start date. If the date is not valid, the function returns a 0.
I4YM or I6YYM
Is the end date. If the date is not valid, the function returns a 0.
Integer
Tip: If from_date or todate is in integer year-month-day format (I6YMD or I8YYMD), simply divide by 100 to convert to year-month format and set the result to an integer. This drops the day portion of the date.
YM calculates the difference between HIRE_MONTH and MONTH_INC and stores the results in a column with the format I3.
YM(HIRE_MONTH, MONTH_INC, 'I3')
iWay Software |