×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

#### Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
To Your Posts
• Keyword Search
• One-Click Access To Your
Favorite Forums
• Automated Signatures
On Your Posts
• Best Of All, It's Free!
• Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

# Microsoft: Access Queries and JET SQL FAQ

 Forum Search FAQs Links MVPs

## Using Functions in Queries

 Rounding Number in a Query or Module by PaulBricker faq701-3133 Posted: 6 Feb 03 (Edited 12 Jan 07) Rounding values can be a daunting task.  If you have Access 2000 or newer, you have the Round Function you can use for many of your calculations.  If you are using Access 97 or have calculations that don't fit in the Round Function format you can try one of these to accomplish what you need. Edited 1/11/07. to adjust for floating point issues with VB6.3  Place them in a new column in your query and replace myField with the name of your Numeric Field.To round to 1 decimal placemyVal:Int(CDec((myField + 0.05) * 100)) / 100123.45 returns 123.5123.44 returns 123.4To round to 2 decimal placesmyVal:Int(CDec(myField+.005)*100)/100123.456 returns 123.46123.454 returns 123.45To round to the nearest ONE digitmyVal:Int(myField + .5)123.55 returns 124123.45 returns 123To round to the nearest TEN digitmyVal:Int(((Int(myField) / 100) + 0.05) * 10) * 10128.45 returns 130123.45 returns 120To round to the HIGHER TEN digitmyVal:Int((((myField + 0.999) / 100) + 0.09) * 10) * 101.01 returns 1010 returns 1010.01 returns 20The alias myVal can be replaced by any text value you want for a field name. Back to Microsoft: Access Queries and JET SQL FAQ Index Back to Microsoft: Access Queries and JET SQL Forum

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!

Already a member? Close this window and log in.