The conversion of a varchar data type to a datetime data type resulted in an out-of-range value (Konwersja typu danych varchar na typ danych datetime spowodowała utworzenie wartości leżącej poza zakresem)
This error can be result of wrong `dateformat` setting on database. Example below. ERROR – `dmy` dateformat: SET DATEFORMAT dmy; DECLARE @datetime datetime = ‘2021-12-31’; SELECT CASE WHEN @datetime >= ‘2021-11-22’ THEN 1 ELSE 0 END;SET DATEFORMAT dmy; DECLARE @datetime datetime = ‘2021-12-31’; SELECT case when @datetime >= ‘2021-11-22’ then 1 else 0 end; OK Read more about The conversion of a varchar data type to a datetime data type resulted in an out-of-range value (Konwersja typu danych varchar na typ danych datetime spowodowała utworzenie wartości leżącej poza zakresem)[…]