rounding values in Access

G

Guest

I have created 2 fields, (Time On Site) and (Customer Charge). I have the
customer charge field setup to calculate the charges based on the value I put
into the (Time On Site) field, ie; 1.25, or 1.75 etc. For some reason, Access
automatically rounds the number down to a whole number (1.00) and gives me an
inaccurate result in the (Customer Charge) field. The (Time On Site) field is
set to long integer, fixed format, and 2 decimal places. The (Customer
Charge) field is a calculated field =[time on site]*50
I can't seem to get the (Time On Site) field allow me to input the correct
values without automatically rounding down.
 
K

Ken Snell [MVP]

Change that Time On Site field to be formatted as a Single or Double numeric
type, and not as a Long Integer or Integer type.
 
G

Guest

Thanks Ken, that worked. Now that I solved that problem, why doesn't the
calculated result appear in my table for the Customer Charge field? This is
the field I will be using on my reports to give me a monthly total.

Ken Snell said:
Change that Time On Site field to be formatted as a Single or Double numeric
type, and not as a Long Integer or Integer type.

--

Ken Snell
<MS ACCESS MVP>

IntruderGT said:
I have created 2 fields, (Time On Site) and (Customer Charge). I have the
customer charge field setup to calculate the charges based on the value I put
into the (Time On Site) field, ie; 1.25, or 1.75 etc. For some reason, Access
automatically rounds the number down to a whole number (1.00) and gives me an
inaccurate result in the (Customer Charge) field. The (Time On Site) field is
set to long integer, fixed format, and 2 decimal places. The (Customer
Charge) field is a calculated field =[time on site]*50
I can't seem to get the (Time On Site) field allow me to input the correct
values without automatically rounding down.
 
R

Rick Brandt

IntruderGT said:
Thanks Ken, that worked. Now that I solved that problem, why doesn't the
calculated result appear in my table for the Customer Charge field? This is
the field I will be using on my reports to give me a monthly total.

A control is ether bound to a field in the table OR contains an expression. It
cannot do both, but nor is it necessary as any value that can be calculated does
not need to be stored in the table. Just put that expression as a calculated
file in a query and use the query any place you would use the table.
 
G

G. Vaught

Calculated fields are not stored and never should be. If you need the value
to appear on a report you create the calculation in a query and use the
query against the report.

IntruderGT said:
Thanks Ken, that worked. Now that I solved that problem, why doesn't the
calculated result appear in my table for the Customer Charge field? This
is
the field I will be using on my reports to give me a monthly total.

Ken Snell said:
Change that Time On Site field to be formatted as a Single or Double
numeric
type, and not as a Long Integer or Integer type.

--

Ken Snell
<MS ACCESS MVP>

IntruderGT said:
I have created 2 fields, (Time On Site) and (Customer Charge). I have
the
customer charge field setup to calculate the charges based on the value
I put
into the (Time On Site) field, ie; 1.25, or 1.75 etc. For some reason, Access
automatically rounds the number down to a whole number (1.00) and gives
me an
inaccurate result in the (Customer Charge) field. The (Time On Site)
field is
set to long integer, fixed format, and 2 decimal places. The (Customer
Charge) field is a calculated field =[time on site]*50
I can't seem to get the (Time On Site) field allow me to input the
correct
values without automatically rounding down.
 

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