Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Order Tag on Numeric String!
Message
 
To
01/07/1999 08:01:11
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00235738
Message ID:
00236615
Views:
11
Justok,

You are incorrect, PADL(...,7) will give this sort order.
      1
     10
    100
    128
    136
   1000
  128BJ
  136KK
If you want 1000 as the last number then separate the salesperson code from the customer code and use two fields for the data. The the sort order will be;
      1
     10
    100
    128
    128
    136
    136
   1000
You can create an index on;

SalesPersonID + CustomerID to get the BJ, KK stuff sorted out within the number.

Your problem here is that you first need to left pad your keys so they all have increasing values. Second you need to correct the table design so that the fields are atomic, that is they cannot be broken apart and still retain meaning. Right now you are using one field to do the work that requires two fields to do.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform