Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

months between

user549774Oct 4 2007 — edited Oct 4 2007
Hi,

i am using this below query

select round(months_between(sysdate,to_date('0407','mmrr'))) from dual

ROUND(MONTHS_BETWEEN(SYSDATE,TO_DATE('0407','MMRR')))
-----------------------------------------------------
6

when i use this query using last_Day

1* select round(months_between(sysdate,last_day(to_date('0407','mmrr')))) from dual
SQL> /

ROUND(MONTHS_BETWEEN(SYSDATE,LAST_DAY(TO_DATE('0407','MMRR'))))
---------------------------------------------------------------
5

pls tell which month difference is correct.Round is correct to use.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 1 2007
Added on Oct 4 2007
3 comments
462 views