select CAST(Right(@max_rec ,2) as int) - CAST(Right(min_rec ,2) as int)
SELECT CAST(REPLACE(max_rec, BRANCH, '') as INT) - CAST(REPLACE(min_rec, BRANCH, '') as INT)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)