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

Drew Wutka DWUTKA at marlow.com
Tue Feb 18 23:42:00 CST 2003


You are absolutely correct, my bad....  Val will return a decimalled number.

Drew

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


Drew,

Hey I'm getting desperate :-)  And I think you are wrong Val() does not
return a long!
I might try the Val inside the cDbl...

cheers

Michael M

Just out of curiousity, why are you wrapping a CDBL function inside of a
Val function?  Val returns a Long INTEGER, not a decimal.  Also, a
Double can be bigger then Long Integer, so it's not a good combination
to mix.

Drew

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


Hi List,

I've been beating my head against the wall for 24 hours now :-( I'm
getting the following error in my VB 6 project and I don't know why...

<Invalid precision for decimal data type.>
<-2147467259>

I'm attempting to execute an Update sql string using the ado connection
object (I tried dao, it failed as well) The query joins 2 saved queries,
which are themselves the product of table and query joins.  I cannot
make major changes to the underlying queries/tables as I am basically
porting an Access db to VB6.  (I didn't write any of the queries... it
all works fine in Access!  When I copy and paste the query into access
it runs with a problem)

I've checked all the data types, joins, casts (even added a Val())!!!  I
also cut 

I modified(below) the sql string to just open a recordset and it throws
the same error!

SELECT [queGetStands(1)].Period, [queGetStands(1)].CropType,
[queGetStands(1)].Forest, [queGetStands(1)].Compartment,
[queGetStands(1)].PatchNumber, [queGetStands(1)].Area,
[queGetStands(1)].StartDate, [queGetStands(1)].AgeClass,
[queGetStands(1)].Linkkey, [queGetStands(1)].SEASON, 
Val(CDbl(Fix([Pruned]*10+0.5*Sgn([Pruned]))/10)) AS Expr3, 
Val(CDbl(Fix([Large Sawlog]*10+0.5*Sgn([Large Sawlog]))/10)) AS Expr4, 
Val(CDbl(Fix([Medium Sawlog]*10+0.5*Sgn([Medium Sawlog]))/10)) AS Expr5,

Val(CDbl(Fix([Small Sawlog]*10+0.5*Sgn([Small Sawlog]))/10)) AS Expr6, 
Val(CDbl(Fix([Pulp]*10+0.5*Sgn([Pulp]))/10)) AS Expr7,
[queGetStands(1)].YieldTable, 'C' AS Expr1, 0 AS Expr2 FROM
[queGetStands(1)] INNER JOIN [queFOLPIOS(1)] ON
([queGetStands(1)].AgeClass = [queFOLPIOS(1)].Age) 
AND ([queGetStands(1)].YieldTable = [queFOLPIOS(1)].OSYieldTable) WHERE
((([queGetStands(1)].Activity)='pulp'));

Has anyone come across this type of thing before????

Cheers

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

_______________________________________________
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