DATEDIFF UDF INTERVAL
Some parts in the output code are omitted for clarity reasons.
Description
This UDF is used to resolve operations with intervals like:
INTERVAL - UNKNOWN
UNKNOWN - INTERVAL
DATE - INTERVAL
TIMESTAMP - INTERVAL
An UNKNOWN type is a column or expression whose type could not be resolved by Snow Convert, it use to happen when the DDLs for tables are not included in the migration or when there is an expression or subquery that can return different data types.
Custom UDF overloads
DATEADD_DDIF(string, date)
Parameters
INTERVAL_VALUE: The interval
String
of the operation.D: The
DATE
where the interval will be subtracted.
DATEADD_DIFF(date, string)
Parameters
D: The
DATE
where the interval will be subtracted.INTERVAL_VALUE: The interval
String
of the operation.
DATEADD_DIFF(string, timestamp)
Parameters
INTERVAL_VALUE: The interval
String
of the operation.D: The
TIMESTAMP
where the interval will be subtracted.
DATEADD_DIFF(timestamp, string)
Parameters
D: The
TIMESTAMP
where the interval will be subtracted.INTERVAL_VALUE: The interval
String
of the operation.
Usage example
Oracle
Snowflake
This configuration was used in Snowflake
Known Issues
1. INTERVAL - INTERVAL Operation is not supported
Snowflake does not support INTERVAL - INTERVAL operations.
Related EWIs
Last updated