Problems with decimals

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

I have created an update query which updates a table with
the result of a calculation , the field in the table that
stores the calculation is to 9 decimal places despite me
putting its format as standard to 2 decimal places in the
table.

This is therefore creating problems when I try and match
data to this field
Any ideas how I can prevent this?
 
Paul said:
I have created an update query which updates a table with
the result of a calculation , the field in the table that
stores the calculation is to 9 decimal places despite me
putting its format as standard to 2 decimal places in the
table.

This is therefore creating problems when I try and match
data to this field
Any ideas how I can prevent this?

The Format and Decimal Places properties only control how the field's
value is displayed, not what it actually contains. You'll need to round
the result of the calculation to the desired number of decimal places
before storing it in the field. For example, if before you had an
update query like this:

UPDATE MyTable
SET MyField = 123 / 456;

you should change it to

UPDATE MyTable
SET MyField = Round(123 / 456, 2);
 
Back
Top