-
Sep 2nd, 2014, 05:33 AM
#1
Thread Starter
New Member
Conversion from string "_0" to type 'Integer' is not valid
I am in the process of converting a program from vb 6 to VB.Net. I am taking a large amount of data and placing it in the proper sql collum.
Any help will be greatly appreciated.
I am getting this error code here:
If ExistsInrsTemp("NextMthDue") = True Then
If InStr(NullSafeValue(rsTemp, "NextMthDue"), "/") > 1 Then
Mid(sDocTrans, 43, 2) = Format(CInt(Left(NullSafeValue(rsTemp, "NextMthDue"), InStr(NullSafeValue(rsTemp, "NextMthDue"), "/") - 1)), "00")
Mid(sDocTrans, 45, 2) = Format(CInt(Mid(NullSafeValue(rsTemp, "NextMthDue"), InStr(NullSafeValue(rsTemp, "NextMthDue"), "/") + 1)), "00")
End if
-
Sep 2nd, 2014, 06:44 AM
#2
Re: Conversion from string "_0" to type 'Integer' is not valid
_0 isn't an integer. 0 (without the underscore) is an integer.
I suspect what's happening is that your date column (which I'm guessing is a varchar rather than a datetime) contain some dates formatted to use underscores as separaotrs. You're code is checking for forward slashes.
The best argument against democracy is a five minute conversation with the average voter - Winston Churchill
Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd
-
Sep 2nd, 2014, 06:51 AM
#3
Thread Starter
New Member
Re: Conversion from string "_0" to type 'Integer' is not valid
Thank you very much! You are correct the date collum is a varchar
-
Sep 2nd, 2014, 10:08 AM
#4
Thread Starter
New Member
Re: Conversion from string "_0" to type 'Integer' is not valid
Did some research, the user entered the wrong data.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|