I am trying to figure out the expression to identify the position of the last character in a text data type field so that I may pass the result to a SUBSTRING function. I have not had any success. I tried to do PATINDEX (RIGHT (fieldname, 1), fieldname), but I got an invalid datatype message. Any ideas?