MSCEWI4054
Explicit cast to DATE added to return value.
Last updated
Explicit cast to DATE added to return value.
Last updated
This is a deprecated version of the SnowConvert documentation, please visit the official site .
Low
This EWI is added when an input user defined function has DATE as its returning type. Its main purpose is informative.
In SQL Server it is possible to return a DATETIME value in a DATE-returning UDF. This is because SQL Server performs an implicit cast. In Snowflake, this is not the case, and compilation time errors may appear if a mismatch exists between the result type and the type stated by the UDF as its return type.
To avoid this, we add a:: DATE
cast to the result of the UDF, inside the outer SELECT statement of the output CTE. This way we ensure congruency between the stated return type and the actual returned value.
If you need more support, you can email us at