DIFF_TIME_PERIOD_UDF

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

Definition

Calculates the difference between two dates depending on the time parameter.

PUBLIC.DIFF_TIME_PERIOD_UDF(TIME STRING, PERIOD VARCHAR(50))

Parameters

TIME STRING

The time to be used in the anchor.

PERIOD VARCHAR

The period column that is used in the expand on.

Returns

A number that represents the difference between two dates.

Usage example

Input:

SELECT DIFF_TIME_PERIOD_UDF('SECONDS','2022-11-26 10:15:20.000*2022-11-26 10:15:25.000');

Output:

5

Last updated