Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
stahorse
Yak Posting Veteran
86 Posts |
Posted - 2012-10-08 : 03:52:22
|
HiI have this code:SELECT [Policy_Id] = SNAP.POLICY_ID ,[Mex_Id] = FR.INV_PTF_NAME,[Rebate_Amount_Gross] = ISNULL(CONVERT(DECIMAL(6,2),((FR.REBATE_RATE * SNAP.TOTAL_UNITS)/100)), 0.00)and I get this error:Arithmetic overflow error converting numeric to data type numeric.please help. |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-10-08 : 05:03:26
|
DECIMAL(6,2) means:- a total of 6 digits- 4 digits to the left of the decimal point- 2 digits to the right of the decimal pointSo maybe 4 digits to the left are not enough?Try DECIMAL(12,2) for example... Too old to Rock'n'Roll too young to die. |
|
|
stahorse
Yak Posting Veteran
86 Posts |
Posted - 2012-10-08 : 06:15:37
|
Thank you it worked. |
|
|
|
|
|