Blog Detail

Date difference in Oracle

07 Oct 10
admin
No Comments
Different date difference function in Oracle:

Date difference in months

select round((MONTHS_BETWEEN(TO_DATE(sysdate), TO_DATE(‘2010-01-01’, ‘YYYY-MM-DD’)))) as mon from dual;

Result: 9

Date difference in days

select to_date(‘7-MAR-2010′) – to_date(’07-FEB-2010’)
from dual

result: 28

Leave A Comment