Below is a block of code that I am using in my Teradata stored procedure. The variableSOAD_START_DATE,LOAD_END_DATE, CURRENT_START_DATE,CURRENT_END_DATE are defined as DATE Variables.
WHILE (LOAD_START_DATE < LOAD_END_DATE) DO IF (DATE LOAD_END_DATE - DATE LOAD_START_DATE) > 90 THEN SET CURRENT_START_DATE = :LOAD_START_DATE; SET CURRENT_END_DATE = :LOAD_START_DATE+90; ELSE SET CURRENT_START_DATE=:LOAD_START_DATE; SET CURRENT_END_DATE=:LOAD_END_DATE; END IF; END WHILE;
Can you please help me understand what is wrong in the code?
You should not have the keyword / built-in function DATE in your IF condition - just the variable names.