DIFF_TIME_PERIOD_UDF

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