Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sorting
Message
 
 
To
29/01/2001 10:47:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00469718
Message ID:
00469864
Views:
16
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform