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