Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sorting
Message
 
 
À
29/01/2001 10:47:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00469718
Message ID:
00469864
Vues:
15
>I have a table with a primary key field that contains data much like this:
>
>A100
>A1000
>A110
>A1100
>A124
>A1240
>
>I would like to sort this data so that:
>
>A100
>A110
>A124
>A1000
>A1100
>A1240
>
>How exactly do I do this? It must be right in front of my face... I just dont see it...
>
>Thanx,
>
>
>Mike

Well, if you would increase number of letters, say,
AB001
AB010
AB10203, etc. in addition to your A001, A1010, A213, it would be hard to create an index expression.

Anyway, what about:
Assuming 6 is the length of PK field:
index on padr(repl("1",len(alltrim(PK))),6,"0")+padr(PK,6,"0")
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform