Access: Sgn Function
In Access, the Sgn function returns the sign of a number (represented as an integer).
The syntax for the Sgn function is:
Sgn ( number )
number is the the number to return the sign for.
Note:
If number is greater than zero, the Sgn function will return 1.
If number is equal to zero, the Sgn function will return 0.
If number is less than zero, the Sng function will return -1.
For example:
Sgn (-123.67) would return -1 Sgn (0) would return 0 Sgn (123.67) would return 1
VBA Code
The Sgn function can be used in VBA code. For example:
Dim LResult As Integer
LResult = Sgn (56)
In this example, the variable called LResult would now contain the value of 1.
SQL/Queries
You can also use the Sgn function in a query.
