October 29, 2012 at 5:24 am
Error is displayed within the excel sheet the database has exported the data into. Only quater of the data that was selected is actually exported at at the top of the excel sheet the database has exported the data to I have an error Microsoft SQL Native Client error '80040e07', Conversion failed when converting the nvarchar value 'Dave Smith' to data type int. /include/aspfunctions.asp, line 1243 ???
I have copied the following Code below the error is refering to :
function db_query(sSQL,conn)
dim asp_rs
if IsIdentical(dDebug,true) then response.write sSQL & "
"
Set asp_rs = server.CreateObject("ADODB.Recordset")
asp_rs.Open sSQL,conn // line 1243 for ref //
call ReportError
set db_query=asp_rs
end function
The database can export small sets of hundreads of records, but thousands I get this error. What is the issue.
October 29, 2012 at 5:55 am
the error is in the query you are creating, which you did not post.
it looks like you are concatenating a number to a string . like CustomerID + ' ' + CustomerName and the result is one column is attempting to convert to an integer, instead of the integer columns converting to varchar, that you seem to expect.
you will have to explictly convert to varchar, and columns that are not varchar, like this: CONVERT(varchar(20),CustomerID) + ' ' + CustomerName
Lowell
October 29, 2012 at 5:56 am
...
The database can export small sets of hundreads of records, but thousands I get this error. What is the issue.
The issue is reported to you: 'Dave Smith' cannot be converted to INT data type.
I guess, that some records in your "thousands" have alpha-numeric values which cannot be converted to INT.
October 29, 2012 at 6:55 am
What would be the easy way to find this within my thousands of records, would you say?
October 29, 2012 at 7:33 am
Lucasprss (10/29/2012)
What would be the easy way to find this within my thousands of records, would you say?
the issue is not with your data.
it's with the query you are using against your data.
show us the query that was in the variable sSQL (called in function db_query(sSQL,conn))
and we can show you how to fix the query you built.
Lowell
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply