|
-
Sep 14th, 2000, 12:20 PM
#1
Thread Starter
Addicted Member
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
-
Sep 14th, 2000, 12:30 PM
#2
Fanatic Member
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
-
Sep 14th, 2000, 12:42 PM
#3
Thread Starter
Addicted Member
Yup so simple thank you!!!
-
Sep 14th, 2000, 04:56 PM
#4
Hyperactive Member
Better late than never...
You can also subtract a number from 0 to reverse the sign.
Code:
var = -10
Debug.Print var, 0 - var
Outputs:
-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
-
Sep 15th, 2000, 05:03 AM
#5
With the Abs-function you get the absolute value
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|