SQL Language (MOSC)

MOSC Banner

Case else statement doesn't work

edited Feb 3, 2012 2:38AM in SQL Language (MOSC) 8 commentsAnswered ✓
Good Morning,

Could someone please take a look at this statement?  The else clause doesn't insert the statement 'NOT FORMATTED' in the NEW DATE column when the statement is executed and discovers that this date  27Feb2008.  I tried changing the apostrophe's etc but no luck.  The pipe I am banging my head with is starting to hurt !!!

I am running oracle 11g on linux.

select date_time,

Case date_time

When date_time

Then  regexp_substr(date_time,'(0?[1-9]|[1-2][0-2]/(0?[1-9]|[1-2][0-9] |3[0-1]/([[:digit:]](4)')

Else 'NOT FORMATTED'

End as "NEW DATE"

From temphone2

where date_time is not null;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center