I am getting a result with in a column of say -1 how to I change this in sql by adding or whatever to make it 1?????
Thanks Gurus
Printable View
I am getting a result with in a column of say -1 how to I change this in sql by adding or whatever to make it 1?????
Thanks Gurus
I'm not sure about SQL at all, but to turn a positive number to negative (or the other way round, conveniently enough ;) ) just multiply it by -1 .
Code:Dim Var As Integer
Var = 5
Form1.Print "Var = " & Var
'Output: 5
Var = Var * -1
Form1.Print "Var = " & Var
'Output: -5
Yup so simple thank you!!!
You can also subtract a number from 0 to reverse the sign.
Outputs:Code:var = -10
Debug.Print var, 0 - var
-10 10
Don't worry if you don't know specific commands in languages for basic mathematical operations. Afterall, all ABS functions do is one of these operations (or possibly change the sign bit of the value using a bitwise operation)
Regards
Paul Lewis
With the Abs-function you get the absolute value