So, I have this function that takes in a datatable and orders the users by two columns. (Rank and OrderCount)

```
Function DetermineBestUser(ByVal usertable As DataTable)
    Dim bestchoice As DataRow()

    For u = 0 To usertable.Rows.Count - 1
        If Not DoesProcessorNeedOrders(usertable.Rows(u).Item("UserName"), usertable.Rows(u).Item("Amount")) Then
            usertable.Rows(u).Delete()
        End If
    Next

    bestchoice = usertable.Select("", "Rank ASC, OrderCount DESC")

    If IsDBNull(usertable) Then
        Console.WriteLine("No user is qualified for this order at this moment")
    End If
    Return bestchoice(0)(0).ToString
End Function

```

The problem is that sometimes this function works correctly and gives me the user with the HIGHEST Rank (1 or 2) and the LOWEST OrderCount (0 - 30+). However, sometimes it does not return the correct person. The only thing i've seen that fixes this is changing the "Ordercount DESC" to "OrderCount ASC"; however, this change only works for that specific order and then it's back to returning the wrong person.

---

I have some test runs that will show this in more detail: R1 & R2 = Rank 1 or 2 / "OrderCount"

```
Rank ASC, Ordercount ASC
#1
dane-R2 / 12
jerm-R1 / 15
tulsa-R1 / 5
---picks Jerm (should pick tulsa)
#2
Dane-R2 / 14
Jerm-R2 / 15
Kate- R2 / 15
---picks Dane 
#3
Dane-R2 / 15
Jerm-R2 / 5
Kate-R2 / 5
---picks dane (should pick Jerm or Kate)

```

---

```
Rank ASC, Ordercount DESC
#1
dane-R2 / 12
jerm-R1 / 15
tulsa-R1 / 5
---picks Tulsa 
#2
Dane-R2 / 14
Jerm-R2 / 15
Kate- R2 / 15
---picks Jerm (should pick Dane)
#3
Dane-R2 / 15
Jerm-R2 / 5
Kate-R2 / 5
---picks Jerm 

```