View Full Version : Arithmetic Overflow error

01-05-2005, 07:46 PM
I am getting the following error:
Microsoft OLE DB Provider for SQL Server error 80040e57.
Arithmetic overflow error converting numeric to data type numeric
positionDisplay.asp line 21 ---- Here is line 21
rsCountPos.open appCountSQL,conn,1,1,1

The strange thing is that this just started after January 1st. On our site we get online job applications and there is also a way for us to go into an 'admin' area of our site to view the app details. We are getting this error only on applications submitted after Jan 1st. Everytime someone submits an application they receive a number. The number is the month, day, year, and then the number of the application received for that day. For example,
app_id = 092120040005 - this would be the fifth application we received on 09/21/2004.

I know practically nothing about SQL and this was kind of put in my lap. Please help! Point me in some direction.

01-05-2005, 09:57 PM
Although that is the line pointed out in the error, the actual error is in the sql string. (appCountSQL) by what you are telling us, this looks like a mathematical operation so show all of the code leading up to this line.

01-05-2005, 10:13 PM
The code is below. Thanks for your reply. Any help is appreciated.
<!--#include file="../../include/connection.asp"-->

function ShowPosDetails(app_ID)
<div align="center">
<table width="672" border=1 style="border-collapse: collapse" bordercolor="#111111">
<span class="genTxt">
'app_id = "092120040005"

appHistSql = "Select * from TN_APPL_EMP_HIST where app_id = '" & app_id & "'"
'response.write appHistSQL
' response.close()
set rsAppHist = Server.CreateObject("ADODB.Recordset")
rsAppHist.open appHistSQL,Conn,1,1,1

appCountSql = "Select Count(*) as cnt from TN_APPL_EMP_HIST where app_id =" & app_id
set rsCountPos = Server.CreateObject("ADODB.Recordset")
rsCountPos.open appCountSQL,conn,1,1,1

appExtSql = "Select * from TN_APPL_EMP_EXT where app_id =" & app_id
set rsAppExt = Server.CreateObject("ADODB.Recordset")
***line 21 rsAppExt.open AppExtSql,conn,1,1,1

'response.write "ctr : " & ctr & "<BR>"
'response.write "Ext_ctr : " & ext_ctr & "<BR>"

01-06-2005, 09:48 AM
does app_id have the same datatype in TN_APPL_EMP_EXT as TN_APPL_EMP_HIST ? .. im sorta just grasping at strings here but it sounds something like you are putting a long into an int or whatever so it needs to convert it but it doesnt fit in that datatype (but im probably wrong *shrugs*)

01-06-2005, 03:38 PM
Yes, the app_id fields are both varchar (12) in both tables. There is also a connection include file at the top of the page. I can past the code of that page if I need to. It has to be related to the new year because it all started on january 1st. I can pull up applications that were submitted before the new year. So, can you or anyone else think of some piece of code (or parameter) that would break this after the new year of 2005. Any advice/help would be greatly appreciated!! Thanks for your reply.

01-08-2005, 08:58 PM
lets see the code that shows this function ShowPosDetails