Calculation field rounds result down!

D

Devin

Access 2003 (WinXP)

I have a simple calculation field on a form that is
adding the sum of a series of totals displayed on a
subform. (The totals are calculated via a query.)

=sum([FieldName])

The problem is that the calculation field is rounding the
numbers down. So that 2.00 + 2.00 + .50 = 4.00 rather
than 4.50

The field is set to 'Standard number' data type
displaying 2 decimals to the right of the decimal point.

Any suggestions?

Thanks!
-devin
 
J

John Vinson

Access 2003 (WinXP)

I have a simple calculation field on a form that is
adding the sum of a series of totals displayed on a
subform. (The totals are calculated via a query.)

=sum([FieldName])

The problem is that the calculation field is rounding the
numbers down. So that 2.00 + 2.00 + .50 = 4.00 rather
than 4.50

The field is set to 'Standard number' data type
displaying 2 decimals to the right of the decimal point.

The default Number type is a Long Integer. Integers, by definition,
are whole numbers.

Use either Float, Double, or (probably better) don't use a Number
datatype at all - use a Currency field. This field type has four
decimal places and (unlike Float or Double) it does not suffer
roundoff error.
 

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