I have a date column that is in the format YYYYMMDD or 20120101. This is because SAP saves it in this format, so it cannot change this.
How can I convert this to YYYY-MM-DD format in a MySQL query? In DB2, I used the to_date () function.
In MySQL, I try to execute the STR_TO_STRING () function, but it returns "null".
SELECT STR_TO_DATE(VBAP.ERDAT,'%Y-%m-%d') FROM VBAP
source
share