Date Trunc

Date/Time Function

Description

Truncate to specified precision.

Click here to navigate to the PostgreSQL docs page for this syntax.

The function Date_trunc() is supported on snowflake but some precision formats are not supported by Snowflake.

Grammar Syntax

DATE_TRUNC ( text, timestamp ) 

Sample Source Patterns

PostgreSQL

SELECT date_trunc('year', TIMESTAMP '2001-02-16 20:38:40');

Snowflake

SELECT date_trunc('year', TIMESTAMP '2001-02-16 20:38:40');

Unsupported Precision Formats

PostgreSQL

Snowflake

  1. MSC-PG0010: PRECISION FORMAT IS NOT SUPPORTED IN SNOWFLAKE.

Last updated

Was this helpful?