Results 1 to 2 of 2

Thread: [RESOLVED] errors from stored procedure..using LEFT, RIGHT

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2009
    Posts
    96

    Resolved [RESOLVED] errors from stored procedure..using LEFT, RIGHT

    I am trying to use LEFT and RIGHT to de-concatenate a length-5 varchar. the parameter @lotname is always something along the lines of "A2646". I run the following lines on my stored proc:

    Set @LotNumber = RIGHT(@lotname, 4)
    Set @Prefix = Left(@lotname', 1)

    But when I use @prefix and @lotnumber in the INSERT command, I get an error along the lines of
    Syntax error converting the varchar value 'A6525' to a column of data type int.
    (@prefix goes to a char(1) column, @lotnumber goes to int(4))

    Based on the error, I would say that the LEFT() and RIGHT() functions aren't working--but the programming console recognizes them (shows up in blue, no errors on compile). Any help?
    Last edited by theguyinthehat; Oct 2nd, 2009 at 06:21 PM.

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