Convert positive number to a negative

  • SQL noob here, but would ABS work?

  • preynolds 73137 (7/26/2011)


    SQL noob here, but would ABS work?

    ABS would work for the opposite, (negative to positive)

  • Deleted because code already posted.


    N 56°04'39.16"
    E 12°55'05.25"

  • steveb. (7/26/2011)


    preynolds 73137 (7/26/2011)


    SQL noob here, but would ABS work?

    ABS would work for the opposite, (negative to positive)

    Except if you combine both

    -ABS(value)

    would always give you a negative result even if value was negative

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Try:

    SET @var = -1 * ABS(@var)

Viewing 5 posts - 16 through 19 (of 19 total)

You must be logged in to reply to this topic. Login to reply