Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rounding to the nearest 100 1

Status
Not open for further replies.

ibvma

Programmer
Jun 24, 2002
5
US
I want to Round currency numbers to the the nearest 100.
ie: $10,436 rounded to $10,400
$32,779 rounded to $32,800

The results can be either text or numerical.

How do I do this in a Query??

Thanks in advance
 
? val(format (10436/100,"0"))*100
? val(format (32779/100,"0"))*100

 
100*Round(myCurrency/100)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
All,
Is there a way to make this work so that it will round up to the nearest 100 no matter if it is below 50 or not

IE

736 would round to 800 instead of down to 700.

Thanks
 
I've just noticed a slight bug in my last post:

((MyVar \ 100) - (MyVar Mod 100 > 0)) * 100

solves it

MyVar Result
100 100
101 200
199 200
200 200
201 300


etc.

Hope this helps.
 
... and to round down to the nearest 100:

(myvar \ 100) * 100


Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top