Hi Jonathan,
To sort the field you can create a formula @test with the code as:
stringvar s := {databasefield};
s := replace(s,"A","");
s := replace(s,"B","");
tonumber(s);
Use this @test formula in the Record Sort Expert.
Right- click the formula and then suppress the formula field by going to Common tab and checking the check box for Suppress.
Hope this helps!!
- Nrupal