Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the Date format of a date filed in snowflake?

i am looking to change in snowflake the values of a date field which has for example this format: 2/10/17, 11/1/17, 12/18/19 to this format: 20010408, 20121226, 20010304.

Thank you

like image 421
Ricky Prince Gouety Avatar asked Jan 31 '26 06:01

Ricky Prince Gouety


1 Answers

I will assume that your date field is a string, since neither of those date formats are actually how Snowflake stores a date. But to convert, you'd do something like this:

SELECT TO_VARCHAR(TO_DATE('2/10/17','MM/DD/YY),'YYYYMMDD');
like image 167
Mike Walton Avatar answered Feb 02 '26 00:02

Mike Walton