Search code examples
oracledenodo

Casting dates on denodo oracle database gives a different formatting


I have a date column and I am trying to cast this into a view with a code below but the output does not match the requirement. I use denodo and oracle 18g as my database.

Column

  A 

1-Dec-20
12-Dec-20
11-Dec-20

Expected output

  A 

1-Dec-20
12-Dec-20
11-Dec-20

output I am getting after running the code below.

select 
to_localdate('dd-MM-yyyy', substring(replace("A", 'NULL', ''), 0, 10)) AS A from "xxtable"

   A
0020-12-01
0020-12-12
0020-12-11

Solution

  • I was able to solve this by using yy instead of yyyy format.

    to_localdate('dd-MM-yy', substring(replace("A", 'NULL', ''), 0, 10)) AS A from "xxtable"