Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ascending w/Descending in same index?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00314175
Message ID:
00314200
Vues:
25
Hi Randy,

>I need to be able to create an index with 2 fields where the first column is ascending and the second column is descending. They are both character fields.

>I am using the follwing index expression:
>UPPER(ts_number)+LTRIM(STR(pr_number,8,0)) DESCENDING

You state that both fields are character fields, but STR() expects a numeric argument.

>However, I really need it to be ascending on the first column, descending on the second within this same index. Any ideas?

That being said you could try this:
UPPER(ts_number) + CHRTRAN(pr_number,"0123456789","9876543210")

All of your data for pr_number was composed of numeric characters thus the CHRTRAN will reverse the ordering for that column.

This is completely off the cuff, but you might give it a try.

HTH,
Ned
Ned

Reality is.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform