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 |
|
vasu4us
Posting Yak Master
102 Posts |
Posted - 2007-02-14 : 15:03:31
|
| Is it possible to write a select statement using IF operator just as we use CASECase WHEN #1 IS NULL THEN #0 WHEN #0<=#1 and #1 IS NOT NULL THEN #0 when #0>#1 and #1 IS NOT NULL THEN #1 Endcan we do the same using if, this is what i did and failedIF #1 is NOT NULL THEN IF #0<#1 THEN #0 Else #1 END ELSE #0 EndThanks in Adv |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-02-14 : 15:06:59
|
| Yes, but not as a part of the SELECT query.Peter LarssonHelsingborg, Sweden |
 |
|
|
snSQL
Master Smack Fu Yak Hacker
1837 Posts |
Posted - 2007-02-14 : 15:07:08
|
| No, and why would you want to when CASE does what you want. |
 |
|
|
vasu4us
Posting Yak Master
102 Posts |
Posted - 2007-02-14 : 15:12:10
|
| i nedd that for writing a function in a report and if it works i have to impliment it in many otherPeso u got it correct i wanted it to work with select and now i know its not possible i have to go with CASEThanks Guys |
 |
|
|
|
|
|