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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what that means

Status
Not open for further replies.

makisbest

Technical User
Mar 3, 2005
125
0
0
GR
I write this code and runs well.



select LItmSale.linkid,
SKMaterial_Value=case
when (LItmSale.Value1>=8 AND LItmSale.Value1<=9) then
convert(varchar(20),convert(decimal(13,4),material.value6))+'|'+convert(varchar(20),convert(decimal(13,4),material.value7))+'|'+'MT'
when (LItmSale.Value1>=13 AND LItmSale.Value1<=14) then
convert(varchar(20),convert(decimal(13,4),material.value8))+'|'+convert(varchar(20),convert(decimal(13,4),material.value9))+'|'+'XT'
else 'TX'
end,
convert(decimal(7,4),DocHdSal.NetValueS)
from litmsale
LEFT JOIN Material WITH (READUNCOMMITTED)
ON (LItmSale.LinkIDNum = Material.AA)
LEFT JOIN DocHdSal WITH (READUNCOMMITTED)
ON (LItmSale.DocumentAA = DocHdSal.AA)


Some times I get this error.

(5 row(s) affected)

Server: Msg 8115, Level 16, State 8, Line 1
Arithmetic overflow error converting numeric to data type numeric.

Little help?

Thanks
 
The precision value that you're using in one of your converts is probably too small. Check the maximum value in each column (Value1, Value2, Value3 etc..) where you're converting to demcimal. A precision of 13 with a scale of 4 gives you a maximum value of 999999999 that can be stored on the left hand side of the decimal point.

Check
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top