Get the difference between two dates both In Months and days in sql
I need to get the difference between two dates say if the difference is 84 days, I should probably have output as 2 months and 14 days, the code I have just gives the totals. Here is the code SELECT Months_between(To_date('20120325', 'YYYYMMDD'), To_date('20120101', 'YYYYMMDD')) num_months, ( To_date('20120325', 'YYYYMMDD') - To_date('20120101', 'YYYYMMDD') ) diff_in_days FROM dual; Output is: NUM_MONTHS DIFF_IN_DAYS 2.774193548 84 I need for example the output for this query to be either 2 months and 14 days at worst, otherwise I won't mind if I can have the exact days after the months figure