I am attempting to convert a date (formatted as yyyy-mm-dd) to a year-month format (ex: 2021-07) while keeping the date datatype.
Coming from SQL Server, this could be done using the FORMAT function like this:
SELECT FORMAT(date_column, 'yyyy-MM')
I am wondering how this could be achieved in SNOWFLAKE. I couldn't find the FORMAT function in SNOWFLAKE so I attempted with DATE, DATE_PART, but they all seem to make my column a varchar, losing its date type.
Thanks.