Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help Creating Case Statements

Status
Not open for further replies.

txdave35

Technical User
Nov 20, 2008
122
0
0
US
Hi guys,

Can someone show me the DB2 structure for creating multiple CASE statments in the same query? I wrote this query, but I get syntax errors:

SELECT RECIP_SSN_NBR,

CASE WHEN BENEF_STAT_CD = 'AC' THEN 'ACTIVE' ELSE 'INACTIVE' END AS TEST,
CASE WHEN BENEF_STAT_CD = 'DP THEN 'DROP' ELSE 'INACTIVE' END AS TEST2


FROM DSNP.PR01_T_RECIP_SYS


Thanks.
 



Hi,

missing a TIC...
Code:
CASE WHEN BENEF_STAT_CD = 'DP[red][b]'[/b][/red]  THEN 'DROP' ELSE 'INACTIVE' END AS TEST2


Skip,
[sup][glasses]Don't let the Diatribe...
talk you to death![tongue][/sup][sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Thanks Skip! I feel stupid, but glad I was close :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top