SGN
Using the Sgn Function
In this tutorial you will learn how to use the SGN Function.
The SGN function returns a Variant (Integer) indicating the sign of a number.
=SGN( number )
number The required number argument can be any valid numeric expression
In this example we will use -3.
The result is -1.
If number is | Sgn returns |
Greater than zero | 1 |
Equal to zero | 0 |
Less than zero | -1 |
Query
The results using a Query would be
SELECT sgn(-3);
FORM
In a Form you could set the Default Value of a Textbox to
=SGN(-3)
VBA
In a Form add a TEXTBOX control and rename it "txtSGN", then you could add the following in the Load Event.
Private Sub Form_Load()
txtSGN = SGN(-3)
End Sub
Courses
Access Expert 26
Search
You can find more about this by searching the website.
By: Alex Hedley
Click here to sign up for more FREE tips
|