Results 1 to 4 of 4

Thread: Conversion from string "_0" to type 'Integer' is not valid

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2013
    Posts
    7

    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

  2. #2
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,900

    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

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2013
    Posts
    7

    Re: Conversion from string "_0" to type 'Integer' is not valid

    Thank you very much! You are correct the date collum is a varchar

  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2013
    Posts
    7

    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
  •  



Click Here to Expand Forum to Full Width