Sorting a Number in a Character Field
Description
This command will allow you to sort the numbers in a character field. Ordinarily if you have sequence numbers in a character type field, the numbers that begin with a 1 (1, 10, 115, 1000, etc) will all appear before records that begin with a 2, which would make sorting pointless. This command puts the numbers in a character type field in a correct numeric sequence.
The Command At Work
Before Command
|
After Command
|
The Command
Copy this command, then paste it into the large text area of the command window:
INDEX ON VAL(cnumber) TAG cnumber
In this command, the cnumber field represents the field that you'd like to sort by. Replace cnumber with your actual field name. After clicking RUN, close the Command window then pull down the Select menu to Show All. You'll notice the field is properly sorted. Also, when you choose ...By Other from the Sort menu, you'll notice cnumber (or whatever word you added after TAG in the command) will appear as an index. Any time you choose to sort by that index, your list will be put in numeric sequence by that field.