Hi,
I am using SQL Server , I have a field name bookid of type varchar.
Example data for this field is given below:
BK1
BK2
BK10
BK11
I am using select substring(max(bookid),3,8)) from tablename to get the max value of Bookid field.
But, the result is : BK2.
Please help me in resolving this issue. I cannot change the datatype of the bookid. Give me a perfect query to get the max value of that varchar field.
Thanks.