Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
tmaiden
Yak Posting Veteran
86 Posts |
Posted - 2006-12-08 : 12:55:35
|
I am trying to get this little bit of sql to work and I am having the worst trouble.SELECT CALLTYPE = CASE WHEN ({CD.CALL_TYPE}=3) then "OUTGOING" elsewhen ({CD.APPLIC_NUM}=1) then "OUTGOING" elsewhen ({CD.DEST_TYPE}="A") then "INCOMING" elsewhen ({CD.ORIG_TYPE}="A") then "OUTGOING" else"UNKNOWN" ENDFROM tablename CDany help would be greatly appriciated! |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-12-08 : 13:03:26
|
| [code]SELECT CALLTYPE = CASE WHEN CD.CALL_TYPE = 3 then 'OUTGOING' when CD.APPLIC_NUM=1 then 'OUTGOING' when CD.DEST_TYPE='A' then 'INCOMING' when CD.ORIG_TYPE='A' then 'OUTGOING' else 'UNKNOWN' ENDFROM tablename CD[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-12-08 : 13:04:33
|
| 1. You should use single quotes for literals.2. If these are meant to be column names {CD.APPLIC_NUM}, you should change them to CD.[APPLIC_NUM]You didn't say what problem you are having, so I can't help you any more than that.CODO ERGO SUM |
 |
|
|
|
|
|