[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Access Rounding Up to Nearest $5

Posted on 2013-06-11
4
Medium Priority
?
902 Views
Last Modified: 2013-06-11
Hi.

I am trying to find a way to round up any given decimal or integer number to the nearest $5 or $0.
Example:  $178.92 rounds up to $180,   $199.01 rounds up to $200,  $231 rounds up $235.

I am using Access 2000 and am trying to do this within an Access update query if possible. The built in rounding function cannot handle this as it will round down as well as up, I beleive. I have tried using the Int() function and get close, but there is always an exception that seems to fail.

I don't mind if I have to write a function, but it seems it should not be that difficult.

Thanks.
0
Comment
Question by:rfmassa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 18

Expert Comment

by:Jerry Miller
ID: 39239426
Have you seen this StackOverflow article?

http://stackoverflow.com/questions/326476/how-to-round-a-number-in-vba-to-the-nearest-5-or-10-or-x

Seems to suit your needs.
0
 

Author Comment

by:rfmassa
ID: 39239488
The StackOverflow I had seen before posting this, but it does not seem to work, as it will round down as well which is not acceptable in this situation for me.
Thanks.
0
 
LVL 29

Accepted Solution

by:
IrogSinta earned 2000 total points
ID: 39239820
Try this:
Round(([Amount]+2.5)/5)*5
round up
0
 

Author Closing Comment

by:rfmassa
ID: 39240028
Genius. Perfect Solution. Thank you!
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question