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

Michael Maddison michael.maddison at ddisolutions.com.au
Wed Feb 19 05:01:01 CST 2003


Hi Michael

You are into deep sh.t here ...

>>>Tell me something I don't know ;-)

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

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

What you probably need is to convert the decimal output of CDbl() to a
string. Str() is for this. And CDbl() is hardly needed for anything as
Fix() returns a numeric.

Thus, I guess you should replace Val(CDbl(Fix(..)/10)) with
Str(Fix(..)/10).

>>>Well worth a try but didn't help.  I've worked my way back through
the nested queries and discovered
the problem arises from the very 1st one :-(  (of course...)  It's a
damn crosstab query.  I had a look at the
data and quickly discovered some null values, after trying varying
combinations of NZ, IiF + IsNull I gave up
and deleted the offending records (they looked wrong anyway ;-).
However the query still produces the same error........
I then removed The Value: Avg(0.1*(Int(10*([Volume])))) and replaced it
with Avg([Volume]) and it works......

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

cheers

Michael M


/gustav

> Hey I'm getting desperate :-)
> I might try the Val inside the cDbl...

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list