Archive for February, 2017

Calculate Year, Month & Days in Oracle

Month_Between function in oracle is used for calculating Year, Month & Days

select    trunc (months_between (end_date, start_date) / 12)
|| ‘ Years ‘ 

       || mod (trunc (months_between (end_date, start_date)), 12)
       || ‘ Months ‘
       || (  to_date (end_date)
           – add_months (start_date,
                         trunc (months_between (end_date, start_date))
                        )
          )
       || ‘ Days’
  from dual;