Decimal data type

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 ?
 
A

Al Camp

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...
 
M

Michel Walsh

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
 

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