Say I am displaying data to a user in a grid, report, drop down box, etc. The data in question contains a field called Invoice Number. This field contains only numerics 2/3 of the time, but the other 1/3 of the time is a mixture of alpha-numerics.
Because of this, any sorting algorithm would sort alpha numerically instead of numerically. For this reason, 1000 would come far before 99. Because the first digit is sorted on - not the entire value. Other items like 000333 would not be treated as "333" and would show up before 222.
Is there any standard here? Should I be attempting to convert all values to a numeric value and sort those differently? How would they get integrated back together? Or is alpha-numeric sorting the correct way to go?