Sgn() and Sqr() function in MS Access

1. Sgn() Function :
sgn() function returns sign of a number.if the number is positive then it returns 1 if number is equal to 0 then it returns 0 otherwise if number is less than 0 then it return -1.

Syntax :

Sgn(number)

Example-1 :

SELECT Sgn(93.5) AS SgnNum;

Output –

SgnNum
1

Example-2 :



SELECT Sgn(-93.5) AS SgnNum;

Output –

SgnNum
-1



2. Sqr() Function :
Sqr() function returns the square root of a number. In this function, a number will be passed as a parameter and it will return the square root of that number.Number must be positive.

Syntax :

Sqr(number)

Example-1

SELECT Sqr(100) AS SqrNum;

Output-

SqrNum
10

Example-2

SELECT Sqr(169) AS SqrNum;

Output –

SqrNum
13
My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.