Home page
 
 Home 
 ASP 
 PHP 
 SQL 
 HTML 
 JavaScript 
 Search 
 Contact 
 
Search
or browse popular tags
Access Functions
Subscription

Sign up for the free email newsletter for new tips, tutorials and more. Enter your email address below, and then click the button.

Privacy Policy

RSS Twitter

Access: Abs Function

Print

In Access, the Abs funtion returns the absolute value of a number.

The syntax for the Abs function is:

Abs( number )

The argument number can be any valid numeric expression. If number contains Null, Null is returned. The absolute value of a number is its unsigned magnitude. For example, ABS(-1) and ABS(1) both return 1.

Example

Abs (-1.45)   returns 1,45
Abs (2.17)    returns 2,17

VBA Code

Dim MyNumber
MyNumber = Abs(42.7)
MyNumber = Abs(-42.7)

This example uses the Abs function to compute the absolute value of a number. Now the MyNumber variable would contain the value 42.7.

SQL query

You can also use the Abs function in a query.

SELECT Abs([Salary]) AS Expr1
FROM EmployeeStatisticsTable


If you'd like to see how it works, enter SQL statement and press Execute
 




Tags:

Add To: Add to dzone dzone | Digg this digg | Add to del.icio.us del.icio.us | Stumble it stumbleupon

  • Comments





Copyright © 2005-2014             www.WebCheatSheet.com All Rights Reserved.