SORTING ALPHANUMERIC DATA

Z

zyus

I have field name [fileref] and the records consists of text & number such as
PP/1/05 , PP/2/05 ...etc.

When i try to sort it the result that i get is PP/1/05 , PP/10/05 ,
PP/2/05....

Need help on how to sort it so i can get PP/1/05, PP/2/05, PP/3/05............

Appreciate your response
 
F

fredg

I have field name [fileref] and the records consists of text & number such as
PP/1/05 , PP/2/05 ...etc.

When i try to sort it the result that i get is PP/1/05 , PP/10/05 ,
PP/2/05....

Need help on how to sort it so i can get PP/1/05, PP/2/05, PP/3/05............

Appreciate your response

It is sorting correctly as a text value.
You want it to sort as a number value of the characters after the
first slash.

Is it ALWAYS 2 letters and a slash?
If so, using a query as record source,

Order By Val(Mid([FieldName],4))

If the number of characters before that first slash can vary in
length, then use:

Order By Val(Mid([FieldName],InStr([FieldName],"/")+1))
 
Top