SQL Msg 8115

Posted on 2013-06-11
Last Modified: 2013-06-11
can you please help,
I'm getting error

Msg 8115, Level 16, State 8, Line 1
Arithmetic overflow error converting varchar to data type numeric
Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to numeric

Select WayBillNumber, ShipmentDate,RepAccountNo,RepName,ShippingAddress,City
From scanitem
WHERE RepAccountNo = 000000000040870 AND shipmentdate > = (Select getdate()-2)

Thank you,
Question by:W.E.B
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
LVL 21

Expert Comment

ID: 39238170
LVL 21

Expert Comment

ID: 39238172
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

LVL 12

Expert Comment

ID: 39238277
Make sure the length of the VARCHAR variable and/or column is long enough to hold the decimal or numeric value:

Author Comment

ID: 39238366
I appreciate if someone can show me how,

I understand the concept that i have to increase the length of the field,but I don't seem to be able to put it together.

LVL 75

Accepted Solution

Anthony Perkins earned 250 total points
ID: 39238721
Try it this way:
SELECT  WayBillNumber ,
        ShipmentDate ,
        RepAccountNo ,
        RepName ,
        ShippingAddress ,
        City ,
        Province ,
        SpecialNote ,
        PostalCode ,
FROM    scanitem
WHERE   RepAccountNo = '000000000040870'
        AND shipmentdate > = DATEADD(day, -2, GETDATE())

Open in new window


Author Comment

ID: 39238742
wow, this did it.
thank you

Author Closing Comment

ID: 39238744
Thank you.
LVL 75

Expert Comment

by:Anthony Perkins
ID: 39238750
If Shipmentdate contains time (as well as a date) then you may want to consider changing the condition from:
AND shipmentdate >= DATEADD(day, -2, GETDATE())
AND shipmentdate >= DATEADD(DAY, -2, DATEDIFF(DAY, 0, GETDATE()))

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor ( Top Charts is a view in which you can set seve…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question