PERIOD_UDF
Definition
User-defined function (UDF) that reproduces the P_INTERSECT operator to compare two or more period expressions and return the overlapping portion of the period expressions.
Generates a varchar representation of the two bounds of a period(TIMESTAMP
, TIME
or DATE
) value, used to emulate the Teradata period value constructor function. This version generates the resulting string using the default format Snowflake has for representing PERIOD
type values, if you require less or more precision either change the session parameter timestamp_output_format or use the three parameters version of this udf
More information about the source function here.
Parameters
TIMESTAMP
The TimeStamp type.
TIME
The Time type.
DATE
The Date type.
PRECISIONDIGITS
The number of TIME digits to display.
Returns
Generates a VARCHAR
representation of the PERIOD
type
Usage example
Input:
Output:
Last updated