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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rounding in Access 97

Status
Not open for further replies.

sunnydanny

Technical User
Jul 31, 2003
5
CA
I have tried a rounding calculation in the control source box of
=(5*.025)*100)/100 which will show 12 instead of 13
I also tried
=(5*.025)*100+.05)/100 which will show 13 but when an imput of 0 is placed where the 5 is I end up with a .01 which is incorrect as it should be 0.

As I know nothing about VB, could someone tell me if it's possible to write a code to do the rounding to two decimals and also show a value of 0 if a 0 is entered?

Thank you
 
I'm not sure if this will work in Access, but it works in Excel. Try entering the following:

To show 13 enter:
=ROUND((5*0.025)*100,0)

To show 0.13 enter:
=ROUND((5*0.025)*100/100,2)

I'm not sitting at my computer, and this one doesn't have Access installed, but I have noticed that a lot of Excel formulas can be used (almost) directly in Access.

Try it out, I hope it works!

Good Luck!



If you can't be "The Best", be the best at what you can!!!

Never say Never!!!
Nothing is impossible!!!
 
Hi sunnydanny,

I know it's not always easy to identify the best forum for a question, but you seem to have posted here while we had an ongoing thread - thread702-618778 - with exactly the same question somewhere else; the usual result of this is confusion. If you reply there (or here if you think it more relevant, but not both) someone may be able to take you forward.

Meanwhile please note that rounding in Access and Excel are different - M$ alone knows why.

Enjoy,
Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top