Hi, sorry not able to help u.sql server so long(7 yrs back...).More over i don't have sql server installed.i used this OBS Lookup in 7.5.x version. From our Forums.
http://caforums.ca.com/t5/CA-Clarity-General-Discussion/NSQL-CASE-WHEN-THEN/m-p/9492 Taken some examples from net. The equivalent of Oracle's DECODE function in SQL Server is the CASE function.
CASE input_expression
WHEN when_expression_1 THEN result_expression_1
[ WHEN when_expression_2 THEN result_expression_2
WHEN when_expression_n THEN result_expression_n ]
[ ELSE else_result_expression ]
END
Example:-
DECODE can be conveniently simulated using the T-SQL CASE expression.
SELECT Sport,
CASE Sport
WHEN 'Cricket' THEN 'England'
WHEN 'Hockey' THEN 'India'
WHEN 'Base Ball' THEN 'America'
ELSE NULL
END AS 'Originating Country'
FROM Sports cheers,sundar