MONTHS_BETWEEN with to_date function : TO_Date « Data Type « Oracle PL / SQL






MONTHS_BETWEEN with to_date function

 
SQL>
SQL> SELECT MONTHS_BETWEEN(TO_DATE('22SEP2006','ddMONyyyy'),
  2    TO_DATE('13OCT2001','ddMONyyyy')) "Months difference"
  3  FROM dual;

Months difference
-----------------
       59.2903226

SQL>
SQL>
SQL>

           
         
  








Related examples in the same category

1.Converting spelled date to DATE format
2.Converting number representation to DATE format
3.TO_CHAR(TO_DATE('04-JUL-15', 'DD-MON-YY'), 'DD-MON-YYYY')
4.TO_DATE('04-JUL-15', 'DD-MON-RR'): Uses the RR format when interpreting the years 15 and 75
5.Use to_date function with between ... and