This discussion is archived
8 Replies Latest reply: Mar 25, 2013 9:09 AM by Srini VEERAVALLI RSS

OBIEE- casting date to char in case functions

NehaSSharma Newbie
Currently Being Moderated
Hi All,

I am trying to implement this scenario in Oracle Answers:

Decode("Dim1".start_date,NULL,'NA',"Dim1".start_date)

I have written something like this in answers:

CASE WHEN "Dim1".start_date IS NULL THEN 'NA' ELSE "Dim1".start_date END

I am getting error here since 'NA' is string type. If I do this:

CASE WHEN "Dim1".start_date IS NULL THEN CAST('NA' AS DATE) ELSE "Dim1".start_date END

I works fine..but is that correct way to code this scenario?Please help

Regards,
Neha

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points