Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6384609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:47:48+00:00 2026-05-25T02:47:48+00:00

I am facing an error on my SQL script: Arithmetic overflow error converting numeric

  • 0

I am facing an error on my SQL script:

Arithmetic overflow error converting numeric to data type numeric

select x.MemberName,x.DOB,x.FilePath,x.Medication,x.NDC,x.Directions,x.Name,x.Strength,x.GenericName,x.QtyOrdered,x.DaysSupply,x.DateFilled, 
CASE
    WHEN x.test = 0  THEN 'N/A'
    WHEN compliance > 100.0   THEN '100.0'
    ELSE CONVERT(VARCHAR(5), CAST(FLOOR(compliance *10)/10.0 AS DECIMAL(3,1)))
END as [Compliance]

I am facing the error on just above syntax line.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:47:48+00:00Added an answer on May 25, 2026 at 2:47 am

    Here’s your problem:

    declare @compliance decimal(10,5)
    
    set @compliance = 100.0  --  <----------------
    
    select CAST(FLOOR(@compliance *10)/10.0 AS DECIMAL(3,1))
    

    Throws “Arithmetic overflow error converting numeric to data type numeric” error. Changing to DECIMAL(4,1) works, or as @paola suggests, change your condition to >= 100.0

    decimal(p,s): 
    

    p (precision) is the maximum total number of decimal digits that will
    be stored, both to the left and to the right of the decimal point. The
    precision must be a value from 1 through the maximum precision of 38.
    The default precision is 18.

    s (scale) is the number of decimal digits that will be stored to the
    right of the decimal point. This number is subtracted from p to
    determine the maximum number of digits to the left of the decimal
    point.

    In your case decimal(3, 1) means a total of 3 digits with 1 digit to the right of the decimal point,

    99.9
    

    whereas decimal(4,1) provides a total of 4 digits with 1 digit to the right of the decimal point,

    999.9
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am facing this error, Cannot create unknown Type '{clr- namespace:ActivityLibrary1;assembly=ActivityLibrary1}MyActivity1' while trying to
I am facing a little trouble with converting this sql to codeigniter syntax. I
I am facing some problems converting the PHP SQL insertion code below to ASP,
I am facing error C2065: 'IOCTL_NDISUIO_OPEN_DEVICE' : undeclared identifier error in beneath code. Where
I am currently facing an error called Bad Base64Coder input character at ... Here
I have a public facing website that has been receiving a number of SQL
I'm facing a weird production problem. Environment is the following: JBOSS 4.0.2 SQL Server
I have created a sample query in sql server to parse data from xml
i am using facelets,richfaces,and ajax, in XHTML i am facing error while creating datepicker!
I am facing the error of error for object 0x1c8250: double free when delloc

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.