Rounddown

A

Aurora

I am using Access 2000.
In a query, I have a calculation (ph01) that comes up with
3 digits on the right side of the decimal pt. Ex: .888

In my report, I want the number to be rounded down to 1
digit on the right side of the decimal pt. Ex using the
above number: .8

In the report, I tried rounddown(ph01,1) but this
formula rounded up insted. my answer was .9. What am I
doing round??? Please help me.

Aurora
 
M

Marshall Barton

Aurora said:
I am using Access 2000.
In a query, I have a calculation (ph01) that comes up with
3 digits on the right side of the decimal pt. Ex: .888

In my report, I want the number to be rounded down to 1
digit on the right side of the decimal pt. Ex using the
above number: .8

In the report, I tried rounddown(ph01,1) but this
formula rounded up insted. my answer was .9. What am I
doing round??? Please help me.


This is truncation (not rounding) and can be done by using
an expression:

=Int(ph01 * 10) / 10
 
A

Aurora

Thank you for your help. Your formula worked great. But
now I have another problem. My report mention below
figures the years of service for employees. And your Int
formula worked great for each year, but when I total the
years I am still getting to much. For Example: I have 1
employee with 8 years of full service, 2 years with
only .8 years of service and 1 year with .3 yrs of
service. When I total these years on a calculator I get
9.9 years. When I add it in the report, using your Int
formula, I get 10 years. (without using INT I get 10.1)
I know this is because the numbers are not a real .8
but .888 and the computer still sees and add the extra
values. Do you have any suggestions as to how to get the
right answer?

Aurora
 
M

Marshall Barton

Aurora said:
Thank you for your help. Your formula worked great. But
now I have another problem. My report mention below
figures the years of service for employees. And your Int
formula worked great for each year, but when I total the
years I am still getting to much. For Example: I have 1
employee with 8 years of full service, 2 years with
only .8 years of service and 1 year with .3 yrs of
service. When I total these years on a calculator I get
9.9 years. When I add it in the report, using your Int
formula, I get 10 years. (without using INT I get 10.1)
I know this is because the numbers are not a real .8
but .888 and the computer still sees and add the extra
values. Do you have any suggestions as to how to get the
right answer?


What fromula are you using to calculate the total?

If its =Int(Sum(ph01) * 10) / 10, then you will get the
truncated total of the untruncated values. If that's what
you're doing, then I think you should be using this instead:

=Sum(Int(ph01 * 10) / 10)

which will give you the total of the truncated values.
--
Marsh
MVP [MS Access]


 

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