SELECT BIBID, SUBSTRING(BIBID, 1, 2) + RIGHT(CONVERT(VARCHAR(8) ,CONVERT(varbinary(4), CONVERT(INT, CONVERT(VARBINARY, '00000' + SUBSTRING(BIBID, 3, 1), 2)) + 1), 2), 1) + RIGHT(BIBID, LEN(BIBID) - 3), RIGHT(CONVERT(VARCHAR(8) ,CONVERT(varbinary(4), CONVERT(INT, CONVERT(VARBINARY, '00000' + SUBSTRING(BIBID, 3, 1), 2)) + 1), 2), 1), SUBSTRING(BIBID, 3, 1) FROM [dbo].[BIBMasterActivityBin]