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 |
|
sqldev6363
Yak Posting Veteran
54 Posts |
Posted - 2008-09-05 : 12:26:06
|
| Hi,I have 2 columns having the sample data like this.COLA COLB-1 2-1 -4-2 41 -3When i am multiplying the two columns i will get if two values having -ve sign then i will get +ve sign.So i need, when i multiply with -1 with -3 or 4 i have to get the +ve sign.In maths if we have -1, if we want to be +ve we will use MOD, like that do we have any other thing in TSQLcan i get query for thisregards |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2008-09-05 : 12:36:17
|
| Are you saying that you want to display -1 * -2 as +2and 1 * 2 as + 2 ?Jim |
 |
|
|
rohitkumar
Constraint Violating Yak Guru
472 Posts |
Posted - 2008-09-05 : 14:58:20
|
| I dont understand your question completely, but you can useSELECT ABS(-1)for MOD |
 |
|
|
sqldev6363
Yak Posting Veteran
54 Posts |
Posted - 2008-09-05 : 15:20:36
|
Thanks rohitquote: Originally posted by rohitkumar I dont understand your question completely, but you can useSELECT ABS(-1)for MOD
|
 |
|
|
sqldev6363
Yak Posting Veteran
54 Posts |
Posted - 2008-09-05 : 15:21:31
|
| Thanks rohit,ABS(-1) is working |
 |
|
|
|
|
|