[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?
Re: [RESOLVED] errors from stored procedure..using LEFT, RIGHT