How to convert a string to date in SAP HANA SQL select statement?

GaRaGe picture GaRaGe · Jan 12, 2017 · Viewed 37.2k times · Source

How do i convert a string '20120215' to a date format YYYY-MM-DD (2012-02-15) in a SQL SELECT statement?

I am using SAP HANA SQL.

Answer

rupat picture rupat · Jan 12, 2017
SELECT TO_DATE('20100112', 'YYYYMMDD') "to date" FROM DUMMY;