SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Arithmetic overflow error converting numeric to da
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

stahorse
Starting Member

42 Posts

Posted - 10/08/2012 :  03:52:22  Show Profile  Reply with Quote
Hi

I 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
Flowing Fount of Yak Knowledge

Germany
8529 Posts

Posted - 10/08/2012 :  05:03:26  Show Profile  Visit webfred's Homepage  Reply with Quote
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 point

So 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.
Go to Top of Page

stahorse
Starting Member

42 Posts

Posted - 10/08/2012 :  06:15:37  Show Profile  Reply with Quote
Thank you it worked.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000