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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

how to add years to the date

850050Feb 24 2012 — edited Feb 25 2012
hi all,
i am using db10g.
i have to add numeric field (year) to the date column
something like if i have date like 03-mar-2000 means i have to add 2 year to the existing year the result should be something like
03-mar-2002
i tried like below
SELECT EMP_DOJ 
FROM EMPLOYEE_MASTER
WHERE EMP_CODE = '0016108'

EMP_DOJ
---------
01-MAR-00

SELECT EMP_DOJ + 2
FROM EMPLOYEE_MASTER
WHERE EMP_CODE = '001610'

EMP_DOJ+2
---------
03-MAR-00
in the result set only date is getting added but i want to add year.
How can i add year. any format is required?

Thanks..
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 24 2012
Added on Feb 24 2012
11 comments
60,853 views