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 |
|
sqlnovice123
Constraint Violating Yak Guru
262 Posts |
Posted - 2010-03-04 : 08:39:26
|
| I need to use the below in a where condition . @ListID is passed as a parameter to the proc. Thanks for your help.like trd.ListID =CASE WHEN @ListID = 'Single Inquiry' THEN WHEN @ListID = 'Lists' THEN ELSE 'All Inquiries' END |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-03-04 : 08:46:40
|
| you can use below. only thing is that you need to have return value for eachWHERE trd.ListID =CASE WHEN @ListID = 'Single Inquiry' THEN value1WHEN @ListID = 'Lists' THEN value2ELSE value3 END.....------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|