Decimal data type

  • Thread starter Thread starter S.L.
  • Start date Start date
S

S.L.

1) AFAIK, There is no specific data type for Decimal. I have to use Variant
for Decimal data type. Is that right ?
2) If my 2 fields, F1 and F2, are Decimal data type. Compare CDec(F1) /
CDec(F2) with CDec(F1/F2), Which one should I use ?
 
SL,
In your table design, set
F1 and F2 to Type = Numeric, and
FieldSize as Single or Double.
I usually don't Format the decimal places in the table. I format for how
many decimal places "on the fly" on my forms/reports/calculations...etc...
 
Hi,


In theory CDec(F1)/F2 or F1/CDec(F2) or CDec(F1)/CDec(F2), but
rather not CDec(F1/F2) because in that latter case, it MAY become that a
standard floating point division occur, with the lost of precision it means,
then the result converted to a scaled integer. Note that as soon as a
CDec( ) occur in the expression, the expression is evaluated at that level
of precision... that is why the first two expressions should be equivalent
to the third expression.


Hoping it may help,
Vanderghast, Access MVP
 
Back
Top