Sharepoint - Sort order issue

Since you are using strings as the data type, you need to format the data differently so that they sort correctly based on alphabetical order, ie

01.0.0
02.0.0
02.0.1
03.0.0
03.0.1
03.1.0
10.0.0
10.0.1
11.0.0

You can write values as 00.00.000 (eg. 01.11.345). Not the best solution but the easiest one.

More complex one is to write your own Custom Field Type.

Also take a look at SharePoint MaskedEdit Field Control and Input-Masking in SharePoint Forms. Not exactly what are you looking for but just as idea (never tested it myself).


Your data is formatted as x.y.z, and you need 3 ordering rules: x ascending, then y ascending, then z ascending. You could use 3 columns to store x, y and z. You would apply the sorting criteria, and for rendering you would use a calculated column: =x+"."+y+"."+z

If it's too many columns to handle, then you would have to use the 00.00.000 format suggested by Vedran. If you don't want to do this manually, you would again use a calculated column that will do the formatting (definitely not a simple formula).

Tags:

Sorting

List