MSCEWI3036

Types resolution issues, the arithmetic operation may not behave correctly between string and date.

triangle-exclamation

Severity

Low

Description

This issue happens when an arithmetic operation may not behave correctly between two certain data types.

Example Code

Input Code:

-- Given the following table
CREATE TABLE TIMES(
AsDate Date,
AsIntervalDaySecond varchar(20)
);

-- An arithmetic operation between two data types that may not behave correctly
SELECT TIMES.AsIntervalYearMonth + TIMES.AsDate FROM TIMES;

Output Code:

circle-info

Note that the operation between a String and Date may not behave correctly.

Recommendations

Last updated