### Title

sort -- number with letters

### Post

I've got a field that always has numbers, but also occasionally has letters.

I'd like it to sort so that the numbers are always in order, but that when the letters appear, those sort as well.

for example:

101, 100, 103, 101A, P103, 101C, 101b, 103A

would sort as follows:

100

101

101a

101b

101c

103

P103

103a

If I make the field a NUMBER field, it ignores all the letters completely.

If I make it a TEXT field, it sorts everything correctly, but puts the "P" prefixes at the end of the list.

I invite your thoughts.

Thanks,

eric

So preceding letters are ignored, first number section is always 4 digits followed by 0 to two digits of either letters, or one letter and one number....

The first field, NumberSection, could be evaluated as Left ( Filter ( AlphaNumeric ; "0123456789" ) ; 4 ) /* left 4 digits drops out any trailing digits */

For the second portion:

Middle ( AlphaNumeric ; Position ( AlphaNumeric ; NumberSection ; 1 ; 1 ) + 4 ) ; 2 )

Assuming you want values to sort in ascending order like this:

1001

1001A

X1001A1

1001AA

That should work for you.