[AccessD] Puzzling error msg? <Invalid precision for decimal data type.>

Gustav Brock gustav at cactus.dk
Wed Feb 19 05:27:00 CST 2003


Hi Michael

> Val() is for converting a numeric string to a numeric (a Long).

>>>>Not quite it will convert to the best match numeric type.

You're right. However, it depends on your decimal separator if it
understands your string correctly.
Here (where decimal separator is comma) I get:

? Val("45,67") => 45
? Val("45.67") => 45,67 

[snip]

> Avg(0.1*(Int(10*([Volume]))))   looks fairly ordinary to me.  Its just
> dropping everything after the 1st decimal place.
> What values would cause a problem?  The guy uses this kind of stuff all
> over the place and I'd like to be able to either fix it
> or tell him why it doesn't work (in VB)...

Except for your Null values which you, of course, have to take care
of, I think your problem is the decimal numbers; decimal separator in
SQL must be dot.
I wonder if this will work:

  Avg(Int(10*[Volume])/10)

/gustav




More information about the AccessD mailing list