Home Privacy Policy Feedback Link to us Site Map Forums

Oracle/PLSQL: NumToYMInterval Function


In Oracle/PLSQL, the numtoyminterval function converts a number to an INTERVAL YEAR TO MONTH literal.

The syntax for the numtoyminterval function is:

numtoyminterval( number, expression )

number is the number to convert to an interval.

expression is the unit. It must be one of the following values: YEAR or MONTH.


Applies To:

  • Oracle 8i, Oracle 9i, Oracle 10g, Oracle 11g

For example:

numtoyminterval(100000000, 'MONTH') would return '+0083'
numtoyminterval(100000, 'YEAR') would return '+0001'