I’m importing a text file containing a field with numbers up to the thousandth decimal as a number field. I’m then running and update query to fix the SSNs (preceding zeros) and subtract 500 from the number field.
UPDATE CODImportFile
SET CODImportFile.[Original SSN] = Format([Original SSN],"000000000")
, CODImportFile.[Lifetime Eligibility Used] = [Lifetime Eligibility Used]-500;
I have no clue why, but some of the results look like this:
Original:500.016
Result: 1.60000000000196E-02
Any idea what could be causing this?
Since the data type of
[Lifetime Eligibility Used]is double, the calculation in your query is similar to this:… which returns this:
Those unexpected decimal places are an artifact of the imprecision inherent with decimal math on a binary system. You could convert the field type to single (or cast double to single in the calculation), but then you would still get “extra” decimal places … just a different set of values for those decimal places.
I think you should discard any decimal places you don’t want to store.
Then you only need decide which rounding method you want.