# Reversing Numbers

• July 10th, 08:30 PM
borr
Reversing Numbers
Is there a function that will turn a -50 into 50 and 50
into -50? I am familier with ABS, but ABS turns everthing
to positive, I just want to revers the signs.

Thanks
• July 10th, 08:38 PM
Vishal Parkar
Re: Reversing Numbers
multiply the number by -1
Ex:
declare x int
select x = -1
select x = (x * -1)
print x

--
-Vishal

"borr" <bdorr39hotmail.com> wrote in message
news:041901c34722\$1a1d16c0\$a301280aphx.gbl...
Quote:

> Is there a function that will turn a -50 into 50 and 50
> into -50? I am familier with ABS, but ABS turns everthing
> to positive, I just want to revers the signs.
>
> Thanks

• July 10th, 08:39 PM
Re: Reversing Numbers

MyValue * -1

"borr" <bdorr39hotmail.com> wrote in message
news:041901c34722\$1a1d16c0\$a301280aphx.gbl...
Quote:

> Is there a function that will turn a -50 into 50 and 50
> into -50? I am familier with ABS, but ABS turns everthing
> to positive, I just want to revers the signs.
>
> Thanks

• July 10th, 08:40 PM
Bob Castleman
Re: Reversing Numbers
How about just multiplying it by -1?

-50 * -1 = 50
50 * -1 = -50

Bob Castleman
SuccessWare Software

"borr" <bdorr39hotmail.com> wrote in message
news:041901c34722\$1a1d16c0\$a301280aphx.gbl...
Quote:

> Is there a function that will turn a -50 into 50 and 50
> into -50? I am familier with ABS, but ABS turns everthing
> to positive, I just want to revers the signs.
>
> Thanks

• July 10th, 08:40 PM
Mike John
Re: Reversing Numbers
How about just multiply by minus 1?

Mike John

"borr" <bdorr39hotmail.com> wrote in message news:041901c34722\$1a1d16c0\$a301280aphx.gbl...
Quote:

> Is there a function that will turn a -50 into 50 and 50
> into -50? I am familier with ABS, but ABS turns everthing
> to positive, I just want to revers the signs.
>
> Thanks
• July 10th, 08:40 PM
Andrew J. Kelly
Re: Reversing Numbers
SELECT CASE YourCol WHEN < 0 THEN ABS(YourCol) ELSE YourCOl * -1 END

--

Andrew J. Kelly
SQL Server MVP

"borr" <bdorr39hotmail.com> wrote in message
news:041901c34722\$1a1d16c0\$a301280aphx.gbl...
Quote:

> Is there a function that will turn a -50 into 50 and 50
> into -50? I am familier with ABS, but ABS turns everthing
> to positive, I just want to revers the signs.
>
> Thanks

• July 10th, 09:06 PM
Reversing Numbers
How about the formula: (0 - 50)

Quote:

>-----Original Message-----
>Is there a function that will turn a -50 into 50 and 50
>into -50? I am familier with ABS, but ABS turns
everthing
Quote:

>to positive, I just want to revers the signs.
>
>Thanks
>.
>
• July 10th, 09:10 PM
Sagar
Reversing Numbers
I meant,

select 0 - (-50) = 50
select 0 - (50) = -50
Quote:

>-----Original Message-----
>Is there a function that will turn a -50 into 50 and 50
>into -50? I am familier with ABS, but ABS turns
everthing
Quote:

>to positive, I just want to revers the signs.
>
>Thanks
>.
>