TIMESTAMP_DIFFERENCE_UDF

circle-info

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 Documentationarrow-up-right

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

Thank you for your understanding.

Definition

UDF That reproduces DATETIME Subtraction

PUBLIC.TIMESTAMP_DIFFERENCE_UDF
(MINUEND TIMESTAMP, SUBTRAHEND TIMESTAMP, INPUT_PART VARCHAR)

Differences between Teradata and Snowflake date time subtraction

Teradata and Snowflake handle date time subtraction different, the syntax, returned type and precision are different.

circle-exclamation

Parameters

MINUEND TIMSTAMP

Date subtracted from.

SUBTRAHEND TIMESTAMP

Date subtracted.

INPUT_PART VARCHAR

Parts to be returned.

Returns

Formatted string value according to the INPUT_PART parameter.

Example

Input

Output:

Last updated