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!

EXTRACT(YEAR FROM DT_OF_BIRTH) AS DTOFBR - showing 1063 instead of 1963

3409791Jun 9 2017 — edited Jun 12 2017

Hi All,

Thanks for your time, I have table in which there is DATE column and it is used to store the date of birth of a person

When I try to calculate the age in terms of years - for one record I have an issue which I cannot determine the problem - in the entire table this is the only record where I see the year as 1063 instead of 1963

any help or suggestions.

EXTRACT(YEAR FROM SYSDATE) - EXTRACT(YEAR FROM A.DT_OF_BIRTH) AS age

EXTRACT(YEAR FROM TO_DATE(A.DT_OF_BIRTH,'DD-MON-YY')) - when I use this it is giving me 2063

EXTRACT(YEAR FROM TO_DATE(A.DT_OF_BIRTH,'DD-MON-YYYY')) AS TEST1 - when I use this it is giving me 63

pastedImage_0.png

Thanks a lot for your time

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 10 2017
Added on Jun 9 2017
31 comments
12,060 views