Calculation/ decimal problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi- Hope you can help!


I am running a macro (Run SQL) as follows:

UPDATE tvc Set field2 = ((ScannedUnits)/BaseUnits)*100 WHERE 1=1

The problem with this statement or field is that it rounds up/down the
calculation.

If the answer is: 118.446, in the field it rounds it down to: 118.00

I have tried setting the decimal point to two or more, but it just gives me
zeros. I want the return result to be the exact calculation of: 118.446.



Hopefully I explained this OK.

Thanks if you can be of any help!
 
What's the data type of field2? When you set a field to Number, the default
Field Size (lower left-hand corner) is Long Integer, which cannot hold any
decimal points. You need to change the Field Size to a type that can hold
decimals: Single, Double or Decimal.
 
Thanks for responding Doug...I have a follow-up question though.

Yes, my field type is Text.

In Field Size it was defaulted to 50. Are you suggesting I change it to
"Decimal?" Or my question is, what do I enter into that field other than
"50?" It appears it only allows me to enter in numbers??
 
What's the data type of field2? When you set a field to Number, the default
Field Size (lower left-hand corner) is Long Integer, which cannot hold any decimal points.

In Access 2007, the default is DECIMAL ;-)

Jamie.

--
 
Back
Top