Problem with sorting numbers in TrackRecord

0 Likes

Problem:

I created an auto-incrementing field called Record#, and I performed a query that selects all tasks, sorting on Record#. If I sort in Ascending fashion, everything works fine, but if I sort in Descending order some of the most recent records appear at the bottom of the list(Currently it is 9 records) Do you know why this is happening?

Resolution:

All sorting in TrackRecord is done using ASCII strings.   TrackRecord does not recognize the numeric value of the numeric digits.

So, if you try to sort on 1,2, 10, 100, 1000,  they will be out of order.  The must contain values which have the same number of digits (i.e. 0001, 0100, 1000).

Set your auto incrementing field to have the same number of digits for all entries as illustrated above for the sorting to work correctly.

Old KB# 11629
Comment List
Related
Recommended