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 |
|
GoDaddy
Yak Posting Veteran
64 Posts |
Posted - 2009-04-21 : 10:36:46
|
| I want in my select to show a function return value if the return value is greater that a value. ex:Select colA, colb, function(@someparam)from etcto show the function(@someparam) only if it return a string greater than 0 for example. is that possible ? |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-04-21 : 10:42:39
|
| What do you want to show if it is less than zero?MadhivananFailing to plan is Planning to fail |
 |
|
|
GoDaddy
Yak Posting Veteran
64 Posts |
Posted - 2009-04-21 : 11:04:06
|
| empty string probably |
 |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2009-04-21 : 11:07:19
|
| Try this..Select colA, colb, case when function(@someparam) > 0 then function(@someparam) else '' endfrom etc |
 |
|
|
whitefang
Enterprise-Level Plonker Who's Not Wrong
272 Posts |
Posted - 2009-04-21 : 11:08:42
|
quote: Originally posted by vijayisonly Try this..Select colA, colb, case when function(@someparam) > 0 then function(@someparam) else '' endfrom etc
The function could just return '' instead. |
 |
|
|
|
|
|