• john.arnott (1/8/2013)


    How annoying. You made me think! 😉

    I agree this was an excellent question and explanation. I do see that one minor correction could be needed to one example given, however. You say "...for example the numeric value 37.2 can be converted to an int (37)...". Did you actually mean that an INT (@i) could be converted to the higher precedence numeric type, as obviously could be the literal value 37.2? After all, the result of that coalesce is 37.2 and not 37.

    yes, I did. Obviously my check-reading what I had written wasn't up to scratch that day. :blush:

    edit: On second thoughts no; what I really meant was that no conversion was required because the decimal value 37.2 already has the type (decimal) with highest precedence of the three parameters to that coalesce expression.

    Tom