Solved

SQL Msg 8115

Posted on 2013-06-11
10
360 Views
Last Modified: 2013-06-11
Hello,
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
,Province,SpecialNote,PostalCode,CCOrderNo
From scanitem
WHERE RepAccountNo = 000000000040870 AND shipmentdate > = (Select getdate()-2)

Thank you,
0
Comment
Question by:Wass_QA
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 21

Expert Comment

by:oleggold
ID: 39238170
0
 
LVL 21

Expert Comment

by:oleggold
ID: 39238172
0
 
LVL 21

Expert Comment

by:oleggold
ID: 39238173
0
 
LVL 21

Expert Comment

by:oleggold
ID: 39238174
0
 
LVL 12

Expert Comment

by:Seaton007
ID: 39238277
Make sure the length of the VARCHAR variable and/or column is long enough to hold the decimal or numeric value:
http://www.sql-server-helper.com/error-messages/msg-8115-numeric-to-varchar.aspx
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:Wass_QA
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.

Thanks,
0
 
LVL 75

Accepted Solution

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

Open in new window

0
 

Author Comment

by:Wass_QA
ID: 39238742
wow, this did it.
thank you
0
 

Author Closing Comment

by:Wass_QA
ID: 39238744
Thank you.
0
 
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())
To:
AND shipmentdate >= DATEADD(DAY, -2, DATEDIFF(DAY, 0, GETDATE()))
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now