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 subtraction not working correctly.

5f1ef332-5417-443d-96cf-e37b5071e1deFeb 10 2017 — edited Feb 10 2017

Hi,

I am trying to get number of days between 2 dates.

The dates are '13 Feb 2017' and '20 Apr 2000'. If I calculate the difference as single statement in TOAD editor, it shows correct result of 6141. But if I do that change in Plsql package and run my web application, it gives difference of 2975 days.

Already tried with couple of date format masks and all work correctly in TOAD editor but not when package is triggered.

Can someone please suggest what we can check.

Thanks.

This post has been answered by AndrewSayer on Feb 10 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 10 2017
Added on Feb 10 2017
10 comments
980 views