Why are you passing a string to an integer? You can use the VAL function toconvert the string into an integer.