algorithm – c++ quicksort routine not sorting correctly

I need to sort a vector of accounts based on postcode.

Here is the routine I am using:

{


    if (l == -1 && r == -1)
    {
    l = 0;
        r = Accounts.size();
    }

    if (l == r) return;
    int pivot = r - 1; // number that we are trying to find the right place for. 
    int a = l, b = r - 2;

    while (a < b)
    {
        if (Accounts(a)->postcode < Accounts(pivot)->postcode) a++;
        else if (Accounts(b)->postcode >= Accounts(pivot)->postcode) b--;
        else swap(Accounts(a), Accounts(b));
    }

    swap(Accounts(pivot), Accounts(a));
    qSort(l, a);
    qSort(a + 1, r);
}

here is the output and as you can see there are errors with L271 – Post Code 2604 and F002 – 6231 Post code being in the wrong place. Can I please get some assistance?

REM                   Removed****       1004    72111.09        113.10
M00ney                   Removed****    1004    26000.12        1024.00
RE                   Removed****        1004    1982123.00      873213.00
123456                   Removed****    1675    8123189.00      3000000.30
REM                   Removed****       2006    1021000.16      0.00
U3123                  Removed****      2006    69600.01        18200.00
**L721                  Removed****       2604    21600.10        103.00**
U2123                  Removed****      2006    21600.00        13.10
123456                  Removed****     2612    146000.14       121024.00
U2122                  Removed****      2612    21600.00        0.00
U1123                   Removed****     2612    21600.00        13.10
U211193                  Removed****    2615    1821600.00      13.10
F001                   Removed****      3018    8096.00 256.00
**F002                  Removed****       6231    1096.00 0.00**
1234567                  Removed****    5278    9999999.99      0.00