SQL - Scalar functions - MONTHS_BETWEEN
The MONTHS_BETWEEN function returns an estimate of the number of months between expression1 and expression2.
The schema is SYSIBM.
If expression1 represents a date that is later than expression2, the result is positive. If expression1 represents a date that is earlier than expression2, the result is negative.
The result of the function is a DECIMAL(31,15). If either argument can be null, the result can be null. If either argument is null, the result is the null value.
SELECT MONTHS_BETWEEN (PRENDATE, PRSDATE) FROM PROJECT WHERE PROJNO='AD3100'
The result is 13.000000000000000.
Note: