Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid scale for decimal data type

Status
Not open for further replies.

exRP12Nuke

Technical User
Oct 5, 2011
49
US
Hello,

I am building an Access program, and when I try to sort one of my final select queries using the drop down menu, it tells me "Invalid scale for decimal data type."

I have looked around Access websites for some help, but most of what I was able to find was about setting the data type in a table, this is a select query so I am not sure what is wrong.

Any help would be greatly appreciated.

Thanks!

-Brett
 
Please post the SQL for the query and the schema you are using.

Beir bua agus beannacht!
 
genomon,

It is a very simple query, although I am not sure what "schema" means. Here is the SQL. Thanks for the help!

Code:
SELECT qrySum.CUNO, qrySum.EQMFSN, qrySum.SVMTHR, qrySum.WONO, qrySum.OPNDT8, qrySum.IVDAT8, qrySum.CompCode, qrySum.CPTMD3, qrySum.PARTS, qrySum.LABOR, qrySum.MISC, qrySum.TLSELL, qrySum.WIP, qrySum.[Mod], qryBudgetAvg.MinOfTLSELL AS BuilderBudget
FROM qrySum INNER JOIN qryBudgetAvg ON (qrySum.[Mod] = qryBudgetAvg.[Mod]) AND (qrySum.CompCode = qryBudgetAvg.CompCode2) AND (qrySum.CPTMD3 = qryBudgetAvg.ModCode)
WHERE (((qrySum.CompCode)<>"3108" And (qrySum.CompCode)<>"4268" And (qrySum.CompCode)<>"1803" And (qrySum.CompCode)<>"4303" And (qrySum.CompCode)<>"4306" And (qrySum.CompCode)<>"5083"));
 
In this case we need to see the datatypes and definitions of the fields you are querying, specifically those with a decimal datatype. Since this is a query of queries, you will have to go to the source tables. At first blush it looks as if the scale/precision properties for one of the decimal data fields cannot handle the size or type of data you are trying to return.
 
genomon,

All of my tables are pulled off of a server through a make table query. The only fields that use decimals are the parts, labor, misc, and tlsell. I will force those into a double and see how that works.


Thanks!
 
genomon,

I just forced all of those fields using CDbl and now it is working correctly.

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top