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 |
|
etietje
Starting Member
24 Posts |
Posted - 2003-02-14 : 15:39:58
|
| I need to do some quick math on a couple of fields, but one of them could be zero. I would like a way to easily set the field to 1 if it is a zero. How would I go about doing that??example the way I have it now. sometimes valueB is a zero.select * from TABLEwhere .10 < (valueA / ValueB) |
|
|
etietje
Starting Member
24 Posts |
Posted - 2003-02-14 : 15:58:53
|
| I knew I was having a brain freeze. Thanks.EDIT: There was a message here about using CASE before...???Edited by - etietje on 02/14/2003 16:00:50 |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-02-14 : 16:06:11
|
| Sorry, that was me. I deleted it because I was going to add more information to the post, but I didn't get around to doing it. |
 |
|
|
ValterBorges
Master Smack Fu Yak Hacker
1429 Posts |
Posted - 2003-02-14 : 19:42:50
|
| SELECT *FROM TABLEWHEREVALUEA / (CASE ValueB WHEN 0 THEN 1) > .10The case statement would prevent the error howeveris this logically correct??? Probably not. |
 |
|
|
|
|
|