try this DECLARE @T TABLE (stuid VARCHAR(10), Name VARCHAR(10))INSERT INTO @TSELECT 'stu01', 'a' UNION ALLSELECT 'stu02', 'b' UNION ALLSELECT 'stu03', 'c' UNION ALLSELECT 'stu04', 'd' UNION ALLSELECT 'stu05', 'e' UNION ALLSELECT 'stu06', 'f' UNION ALLSELECT 'stu07', 'g' UNION ALLSELECT 'stu08', 'h' UNION ALLSELECT 'stu09', 'i' UNION ALLSELECT 'stu10', 'j' UNION ALLSELECT 'stu11', 'k'SELECT * FROM @TWHERE CONVERT(INT, SUBSTRING(stuid, 4, LEN(stuid))) BETWEEN 6 AND 10
"There is only one difference between a dream and an aim. A dream requires soundless sleep to see, whereas an aim requires sleepless efforts to achieve..!!"