[thelist] 1.1.2 Sorting

Joel Canfield joel at spinhead.com
Thu Dec 5 14:38:01 CST 2002


--
[ Picked text/plain from multipart/alternative ]
> > We have a list that is currently stored as a text field
> since it isn't
> > a true number (e.g. 1.1.2, 1.1.3).  Is there any way to sort this?
>
> Did you try standard Alpha-Numeric sorting? Logic says that
> it should work.

Not when you get to 1.1.11, 1.1.12 - you'll get

1.1.1
1.1.10
1.1.11
1.1.12
1.1.2
1.1.3
etc.

Your only hope is to parse it on the periods, sort each field left to right,
then rebuild the strings.

joel



More information about the thelist mailing list