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!

date arithmetic, to_char working fine but to_date not ?

Ahmed HaroonOct 25 2016 — edited Oct 26 2016

I was calculating period in months, following is screen shot, when using to_char for sysdate it is working fine but when using to_date it returns wrong value. please help to understand it.

I am using following DB version.

BANNER

------------------------------------------------------------

Oracle Database 11g Release 11.2.0.4.0 - 64bit Production

PL/SQL Release 11.2.0.4.0 - Production

CORE 11.2.0.4.0 Production

TNS for 64-bit Windows: Version 11.2.0.4.0 - Production

NLSRTL Version 11.2.0.4.0 - Production

months_calc.JPG

Regards

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 22 2016
Added on Oct 25 2016
10 comments
373 views