Home page
 
 Home 
 ASP 
 PHP 
 SQL 
 HTML 
 JavaScript 
 Search 
 Contact 
 


Search
or browse popular tags
Got questions?

We got answers.

Ask your question about PHP, ASP, Javascript, HTML, CSS, hosting and get professional help, free of charge.

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

Home / SQL / Access Functions

 

 

Access: Round Function

Print Bookmark and Share

In Access, the Round function returns a number rounded to a specified number of decimal places.

The syntax for the Round function is:

Round( expression [,numdecimalplaces] )

The argument number can be any valid numeric expression. The numdecimalplaces argument is is the number of decimal places to round the expression to. If this parameter is omitted, then the Round function will return an integer.

Example

Round (2.38,1)       returns 2.4
Round (2.38,0)       returns 2
Round (2.38,1)       returns 2
Round (2.75,1)       returns 2.8
Round (2.65,1)       returns 2.6
Round (2.55,1)       returns 2.6


If the expression that you are rounding ends with a 5, the Round function will round the expression so that the last digit is an even number.

VBA Code

Dim MyNumber As Double
MyNumber = Round(2.38,1)

This example uses the Round function to round a  integer to a specified number of decimals. Now the MyNumber variable would contain the value 2.4.

SQL query

You can also use the Round function in a query.

SELECT Round(24.65487,2) AS Expr1
FROM Orders


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

Need help with ASP, PHP, Javascript?

Let our experts help you.
 
 
ASPRunner.NET - code generator for ASP.NET
Web hosting from $5/month (PHP,ASP,MySQL,unlimited emails)



Tags: ACCESS FUNCTION ROUND SPECIFIED DECIMAL

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

  • Comments (1)





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