If you’re getting error 245 that reads something like “Conversion failed when converting the varchar value ‘Five’ to data type int” when using the LEAST()
or GREATEST()
functions in SQL Server, it’s probably because your arguments aren’t of a comparable data type.
When using LEAST()
and GREATEST()
, all arguments must be of a data type that is comparable and that can be implicitly converted to the data type of the argument with the highest precedence.
To fix this issue, be sure to pass arguments of comparable data types.
Continue reading