Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
INDEX ON....IIF(x,'ASCENDING','DESCENDING')
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00350533
Message ID:
00350566
Vues:
25
The closest I could get was either:

INDEX ON IIF(VAL2 = "D", 1/(VAL(VAL1)+1), VAL1+VAL2) TAG Test1

or

INDEX ON IIF(VAL2 = "D", 1/(VAL(VAL1)+1), VAL1) TAG Test2

Needless to say, I would betRushmore will be shot to hell on something like this.

>I'm trying to create an index that will internally change back and forth between Ascending and Descending depending on the value of a field.
>
>Let's say I have a table with the following fields and values.
>
>cValue AorD
>01 A
>02 A
>03 D
>04 D
>05 A
>06 A
>07 D
>08 D
>
>I want to index on cValue Descending but internally cValue would be subIndexed as either Ascending or Descending depending on the value of AorD so that the final index would produce the following result.
>
>cValue AorD
>01 A
>02 A
>04 D
>03 D
>05 A
>06 A
>08 D
>07 D
>
>Can anyone think of a way to do this even using UDFs if needed?
>
>Ed
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform