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 |
|
sqlbug
Posting Yak Master
201 Posts |
Posted - 2010-03-22 : 16:27:48
|
I have this procedure where I am using a Case statement like:SELECT...CASE Sample_TimeWHEN '0' THEN '1'WHEN '100' THEN '2'.....and so on I need to add an additional condition here so if the value of a variable - @Sample_Type <> '1' , then Sample_Time = 'n/a'...instead of one of those 1, 2, 3..24 values it gets from the Case statement.Any ideas how I can do it?Thanks,sqlbug |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2010-03-22 : 16:53:29
|
| [code]SELECT case when @Sample_Type <> '1' then 'n/a' elseCASE Sample_TimeWHEN '0' THEN '1'WHEN '100' THEN '2'...ENDend as [urcolumn][/code] |
 |
|
|
sqlbug
Posting Yak Master
201 Posts |
Posted - 2010-03-22 : 17:20:03
|
| Thanks vijay.. |
 |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2010-03-22 : 17:57:04
|
| np..you're welcome. |
 |
|
|
|
|
|