Dear,
I have a need to compare dates of a data with an idle date, but for some dates it makes the comparison and able to provide appropriate result but for some it doesn't.
-Format of the date is identical throughout.
-- WHEN FORMATDATE(DATE(FORMATEDATE(T1.'ECU'))) < FORMATDATE("13.12.2021") THEN FORMATDATE("13.12.2021")
ELSE T1.'ECU'
END AS 'ECU-NEW'
Example
ECU ECU-NEW
1) 18.01.2021 18.01.2021 (Condition didn't fill, the result should be 13.12.2021.)
2) 12.01.2021 13.12.2021
3) 18.01.2022 18.01.2022
4) 10.12.2021 13.12.2021