Access Rounding Up to Nearest $5

Posted on 2013-06-11
Medium Priority
Last Modified: 2013-06-11

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.

Question by:rfmassa
  • 2
LVL 18

Expert Comment

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


Seems to suit your needs.

Author Comment

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.
LVL 29

Accepted Solution

IrogSinta earned 2000 total points
ID: 39239820
Try this:
round up

Author Closing Comment

ID: 39240028
Genius. Perfect Solution. Thank you!

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
If you need to implement application level security in an Access database application or other VBA code, I strongly encourage you to take advantage of Active Directory groups.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Hi, this video explains a free download that you can incorporate into your Access databases, or use stand-alone for contact management. Contacts -- Names, Addresses, Phone Numbers, eMail Addresses, Websites, Lists, Projects, Notes, Attachments…

623 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