Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Difficult index
Message
 
To
05/06/2006 11:24:24
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
01127110
Message ID:
01127116
Views:
10
>I need to index a field that contains values like:
>
>RTA-1
>RTA-2
>RTA-3
>RTA-3a
>RTA-10
>RTA-10a
>RTA-10b
>
>etc. How would you construct an index statement that would sort in the order shown?
>
>index on left(sponsor_id,4) + str(val(substr(sponsor_id,5,8))) to temp
>
>almost works but misses the alpha in the last position.
>
>
>Thanks
index on left(sponsor_id,4) + PADL(ALLTRIM(substr(sponsor_id,5,8)),8,[0]) to temp
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform