RawFocus RawFocus - 1 year ago 122
SQL Question

Netezza SQL syntax to convert numeric YYYYMMDD format into date

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?


SELECT somefunction(20090731) as NZDATE


Ian Ian
Answer Source

Easiest way to convert number to date would be

select  date(to_char(20090731,'99999999')) as Number_As_DATE;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download