Firstly, if the claim total is always derivable from the sum of the claim
detail amounts then it should not be stored in a column in the claims table
but computed on the fly in a query whenever needed. Only if its legitimate
for the total to be altered independently of the sum of detail amounts should
it be stored. Otherwise its introducing redundancy and the possibility of
inconsistent data.
As regards the 'loss of cents' do you mean its rounding to an integer or is
the total showing a discrepancy in the cents compared with what you get if
you add up the detail amounts manually. If the former it suggests that the
data type of the column in Claims is an integer, but currency in claims
details. Both should be currency. If the latter, then this might be due to
the fact that the actual underlying detail amounts differ from what you see,
which may be the case if they result from some computation rather than being
manually entered. This is because the currency data type is to a precision
of 4 decimal places, but you see the values rounded to 2 decimal places.
This suppresses cumulative rounding errors, which is what's happening in your
case if this is the case. If you want the totals to be what you'd get if you
added the amounts up manually then you should sum the detail amounts rounded
to 2 decimal places, not the actual stored values.
Ken Sheridan
Stafford, England