calculated fields

A

anj

I have created a calculated field [MileageDue] = [Miles]*.59 whose data
format is currency . My problem is that when I try to use that calculated
field in another expression (i.e. =Sum([CashItemAmount])+Sum([Mileage Due])
the resultant amount adds the MileageDue dollars but not the cents (I know,
weird!) What am I doing wrong - I am going crazy trying to figure this out.



AnJ
 
K

Ken Sheridan

When you say 'not the cents' do you mean that the cents are always zero in
the result or that there is a discrepancy between what you get if you add up
all the MileageDue amounts you see in the column if listed individually and
what you see when you Sum them. If the latter then its due to the fact that
the currency data type has a precision to 4 decimal places, but you see only
two. The sum, therefore might be the sum of the more precise underlying
values rather than of the perceived values rounded to 2 decimal places. This
is really the 'correct' sum because the very reason that the data type is
precise to 4 decimal places is to iron out cumulative rounding errors. If
you want to produce a sum which is what you'd get by adding up all the
individual amounts as seen to 2 decimal places then you'd need to round them
to 2 decimal places before summing.

If the final amount always shows no cents that sound more like its formatted
as an integer or rounded to zero decimal places in some other way.

Ken Sheridan
Stafford, England
 

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