SSC-EWI-TS0060
Datetime interval not supported by Snowflake.
Severity
Medium
Description
This EWI is added when one of the following time parts is used as a parameter for a date-related function because they are not supported in Snowflake. For more information go to 'supported date time parts (Date & Time Functions | Snowflake Documentation).
Code Example
Input code
SELECT
-- Supported
DATEPART(second, getdate()),
-- Not supported
DATEPART(millisecond, getdate()),
DATEPART(microsecond, getdate());
Output code:
SELECT
-- Supported
DATE_PART(second, CURRENT_TIMESTAMP() :: TIMESTAMP),
-- Not supported
!!!RESOLVE EWI!!! /*** SSC-EWI-TS0060 - TIME PART 'millisecond' NOT SUPPORTED AS A FUNCTION PARAMETER ***/!!!
DATEPART(millisecond, CURRENT_TIMESTAMP() :: TIMESTAMP),
!!!RESOLVE EWI!!! /*** SSC-EWI-TS0060 - TIME PART 'microsecond' NOT SUPPORTED AS A FUNCTION PARAMETER ***/!!!
DATEPART(microsecond, CURRENT_TIMESTAMP() :: TIMESTAMP);
Recommendations
An UDF could be created to manually extract unsupported time parts in Snowflake.
If you need more support, you can email us at snowconvert-support@snowflake.com
Last updated