Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SORT ORDER in SELECT?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00381276
Message ID:
00381287
Views:
15
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform