You can place a CASE expression anywhere an expression is allowed. It chooses an expression to evaluate based on a boolean test.
ThenExpression and elseExpression are both expressions that must be type-compatible. For built-in types, this means that the types must be the same or a built-in broadening conversion must exist between the types.