Netezza SQL syntax to convert numeric YYYYMMDD format into date

Allan Bowe picture Allan Bowe · Jul 31, 2009 · Viewed 58.8k times · Source

We have a Netezza table that contains dates stored in a numeric YYYYMMDD format (eg 20090731).

What is the best Netezza syntax to use to convert this into date format?

eg

SELECT somefunction(20090731) as NZDATE

?

Answer

user447151 picture user447151 · Sep 14, 2010

You can use this one as it's the best one.

SELECT TO_DATE('20090731','YYYYMMDD') as NZDATE