Search code examples
sqldatetimesnowflake-cloud-data-platformdate-arithmetic

How to truncate a date to the first day of the month in Snowflake?


I am not able to find any good conversion code to get 2014-02-17 into 2014-02-01 without having to use concatenation and a ton of formatting. I wonder if someone can help me find a good command to achieve this. Thanks!


Solution

  • This is another option:

    SELECT TRUNCTIMESTAMPTOMONTH(CURRENT_DATE());