Rounding numbers

R

Robin Linton

How can I round numbers to the nearest tenth. I have
several calculations in place and I have to round my
number to the nearest tenth at a certain point in the
calculation.

Example 131-60 =77
77 x .25 = 17.75
17.75 + 60 = 77.75
77.75 / 15 = 5.18 ( I need the 5.18 to round off to 5.2)
5.2 x 41
 
J

John Vinson

How can I round numbers to the nearest tenth. I have
several calculations in place and I have to round my
number to the nearest tenth at a certain point in the
calculation.

Example 131-60 =77
77 x .25 = 17.75
17.75 + 60 = 77.75
77.75 / 15 = 5.18 ( I need the 5.18 to round off to 5.2)
5.2 x 41

Use the Round() function:

Round(77.5 / 15, 1)
 
R

Robin Linton

That worked great, but what if I don't know the value of
the number I want teo divide and round off. I'm updating
thousands of record at a time and the number will be
different in most cases. The field where the 77.75 goes
is called Anes/Ob Total. I tried Round(Anes/Ob
Total)/15,1 and I get a syntax error.
 
J

John Vinson

The field where the 77.75 goes
is called Anes/Ob Total. I tried Round(Anes/Ob
Total)/15,1 and I get a syntax error.

If you have blanks in the fieldname (or other special characters) you
must enclose the fieldname in square brackets; I do so routinely for
fields just to avoid confusion with strings and to make the code
easier to read. You also have a misplaced parenthesis. Try

Round(([Anes] / [Ob Total])/15, 1)
 
R

Robin Linton

Thanks, I finally got it to work
-----Original Message-----
The field where the 77.75 goes
is called Anes/Ob Total. I tried Round(Anes/Ob
Total)/15,1 and I get a syntax error.

If you have blanks in the fieldname (or other special characters) you
must enclose the fieldname in square brackets; I do so routinely for
fields just to avoid confusion with strings and to make the code
easier to read. You also have a misplaced parenthesis. Try

Round(([Anes] / [Ob Total])/15, 1)




.
 

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

Similar Threads

Rounding Numbers 1
rounding problems 11
Round-Up question 2
Rounding 10
Access 2007: % fields rounding to nearest integer 3
Rounding 2
Sumproduct error 2
Rounding to a given precision 2

Top