I have a field that usually contains alphanumeric values, but not always. So "numbers" end up sorted as 1,10,11,12,2,3,4,.... instead of 1,2,...10,11,12
Other than avoiding using "digits only" is there a way to cause an index to sort "properly" ?
Other than avoiding using "digits only" is there a way to cause an index to sort "properly" ?
Prefixing with "0" or use an additional (numeric) field that you maintain under the covers (depending on your architecture in a Trigger, SDO or Business Entity) that is indexed and provides the desired sort.
Bottom line, if you want it to sort like a number, define it as a number. By normal rules, it *is* sorting properly.
Which said, as Mike says, you can zero pad when you fill the list. I.e., ttStuff.chSortField = string(inSomeNumber,"9999999").
Thanks, I wanted to make sure there wasn't a secret handshake I was missing
It's the DWIWNWIS* switch!
*Do What I Want, Not What I Say"