Function reference
Tests the values of a column or expression and returns values based on the results of the test.

Case ( column WHEN value1 THEN result1 { WHEN value2 THEN result2 { … } } { ELSE resultelse } )

Argument Description
column The column or expression whose values you want to test.
WHEN Introduces a value-result pair. At least one WHEN is required.
value One or more values that you want to compare to values of column.
THEN Introduces the result to be returned when column matches the corresponding value.
result An expression whose value is returned by Case for the corresponding value. All result values must be the same datatype.
ELSE (optional) Specifies that for any values of column that do not match any of the values, already specified, Case returns resultelse.
resultelse An expression whose value is returned by Case when the value of column does not match any WHEN value expression.

Data type: The datatype of result
Returns the result you specify in result/resultelse.
If more than one WHEN clause matches column, Case returns the result of the first matching one.


Case( [MyField] WHEN ‘a’ THEN ‘Open’ WHEN ‘b’ THEN ‘Closed’ WHEN ‘c’ THEN ‘expired’ Else ‘Not valid!’)


Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment