Rounding Trick

S

stephen.h.dow

This might be obvious, but I needed to round values to the tens or
hundreds (not tenths or hundreths). The Round function in SQL for
Access does not allow negative decimal assignment (as in Excel). So,
there was no way to get $7536 to round to $7500.

However, simple arithmetic came in handy:

round(<tbl.value>/100,0)*100 AS RoundedValue
 
A

Allen Browne

Thanks for posting Stephen.

I did place a request to get the Round() function in Access to accept
negative exponent (as Excel does.) No one seemed interested, so it hasn't
happened.

The approach you suggested is probably the simplest workaround.

For anyone researching rounding in Access, here's some suggestions covering
the most common needs:
http://allenbrowne.com/round.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top