ronaldmacdonald
MIS
Hi
I am wondering if its possible to use a case statement in a select query. For example I have a field that contains 3 possible values A,B or C. As I select these fields I want to display a different value as thus:
A = X
B = Y
C = Z
I thought something like:
SELECT 'status' = CASE WHEN Field = 'A' THEN 'X' WHEN Field = 'B' THEN 'Y' WHEN Field = 'C' THEN 'Z' END)
But this doesnt seem to work?
I am wondering if its possible to use a case statement in a select query. For example I have a field that contains 3 possible values A,B or C. As I select these fields I want to display a different value as thus:
A = X
B = Y
C = Z
I thought something like:
SELECT 'status' = CASE WHEN Field = 'A' THEN 'X' WHEN Field = 'B' THEN 'Y' WHEN Field = 'C' THEN 'Z' END)
But this doesnt seem to work?