Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SORT ORDER in SELECT?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00381276
Message ID:
00381287
Vues:
16
>Is there a way to put multiple SORT ORDERS based upon a user's choice from a drop-down combo on a form in a SELECT SQL command?
>
>I am trying to avoid repeating the same multi-line SELECT SQL command for different SORT ORDERS that a user wants.
>
>I would like to do:
>SELECT a.* FROM myTable SORT ORDER a.date (if user wants date order)
>or
>SORT ORDER a.name (if user wants name order)
>or SORT ORDER a.address (if user want address order)
>INTO CURSOR myCursor

No, you can do it with one SQL:

SELECT a.* FROM myTable...
...INTO CURSOR myCursor NOFILTER

INDEX ON &somefield TAG mytag

where "somefield" is the given order field you want. If you want more than one ordering on the same cursor, do the USE AGAIN method (you may have heard about this by now).
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform