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

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Wed Feb 19 06:11:01 CST 2003


> I think you are wrong in your statement below,
Michael,

Yes, you're right  - Avg(0.1*(Int(10*([Volume])))) -  works for DAO and ADO
and VB6 here.
I was surprised! :) - I didn't know/I did forget that because I prefer to
never use VBA functions in queries
especially if there are any chances that they will be upsized...

So this query

SELECT Avg(0.1*(Int(10*([Volume])))) From <YourTableNameHere>

works here.
What EXACTLY is your simplest query which doesn't work? - what is its SQL
expression?
This query above doesn't work?
What error message it gives? - 'Invalid precision for decimal data type'?
What is your ADO connection string?
What are your regional settings for numbers?
BTW, have you tried to change Value field name in your crosstab query? I
mean instead of Value use
MyValue or something like that? Reason: Value is a reserved word and may
give nasty side effects in absolutely unexpected situations...

If you send me your base table(s) with some data + queries + problematic
code - all extracted into small access database I can check them here in
VB6...

Shamil

----- Original Message -----
From: "Michael Maddison" <michael.maddison at ddisolutions.com.au>
To: <accessd at databaseadvisors.com>
Sent: Wednesday, February 19, 2003 2:18 PM
Subject: RE: [AccessD] Puzzling error msg? <Invalid precision for decimal
data type.>


> Shamil,
>
> The problem was in one of the underlying base queries (crosstab).
> The Value: Avg(0.1*(Int(10*([Volume]))))  I modified this to The Value:
> Avg([Volume]) and the whole lot worked!
>
> I think you are wrong in your statement below, you can use all of those
> things as I understand it.  What you can't use is
> Access functions like NZ().
>
> I'd still like to know WHY it failed though.
>
> Thanks for the help everyone.
>
> Cheers
>
> Michael M
>
> Michael,
>
> But you can't use VBA functions(even if they have VB6 equivalents) in
> queries when you're working with VB6 - nor in query expression nor in
> all the underlaying queries. Even string concatenation in a query
> expression is treated as an operation, which needs VBAxxxxx.dll AFAIK...
> or I didn't get what your problem is...
>
> Shamil
> _______________________________________________
> 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