Link to home
Start Free TrialLog in
Avatar of rfmassa
rfmassa

asked on

Access Rounding Up to Nearest $5

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.
Avatar of Jerry Miller
Jerry Miller
Flag of United States of America image

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.
Avatar of rfmassa
rfmassa

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of IrogSinta
IrogSinta
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rfmassa

ASKER

Genius. Perfect Solution. Thank you!