Skip to Main Content

Oracle Database Express Edition (XE)

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!

Year function in Oracle database to extract year value based on case statments

ForSlyJul 31 2018 — edited Jul 31 2018

I am trying to extract a year using the following case statement in oracle but I am getting an invalid identifier error on the YEAR function. anyone know where I might be going wrong or how I can extract a year based on the following?

YEAR(CASE when XYX = 'Hired - External' AND YZN = 'Hire' THENĀ  CURRENT_DATE END) AS P_YEAR

I expect something like this

YEAR

2018

2017

2016

2015

This post has been answered by ForSly on Jul 31 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 28 2018
Added on Jul 31 2018
3 comments
2,908 views