Skip to content
Advertisement

Change Dateformat in a Column from dd.mm.yyyy to yyyy-mm-dd in SQL

I have a column with Dates like ‘12.05.2021’ and I want to transform the Dates to following format: 2021-05-12. But I dont know how to do it.

Advertisement

Answer

i assume it’s in string ,so :

SELECT TO_VARCHAR(TO_DATE('12.05.2021' ,'MM.DD.YYYY'),'YYYY-MM-DD');
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement