Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Descending index on a view 2

Status
Not open for further replies.

paul060769

Programmer
May 1, 2001
5
US
I have a grid that displays a local view.

I want to be able to index the records of the view based upon a field (lastname) in ascending OR descending order.

I can't use the ASCENDING or DESCENDING clause in the INDEX ON... command.

Thanks...
Paul
 
Hi Paul,

I'm not sure why you can't use ASCENDING/DESCENDING in the INDEX ON command, but those keywords are also available in the SET ORDER and SET INDEX commands.

Jim
 
Just create two separate indexes on the table, one ascending and one descending with different names. Then use:

Code:
USE mytable
SET INDEX TO 'mytable.cdx' ORDER 1  && for first index or

SET INDEX TO 'mytable.cdx' ORDER 21  && for second index

Dave Dardinger

 
Thanks guys. Great answers.

FYI -

INDEX ON exp1 TO <file> DESCENDING

ERROR!!!

This is a view. Can't seem to create any .cdx for it.

But, you guys did help us figure out the answer.

INDEX ON exp1 TO <file>

SET ORDER TO 1 ASCENDING
or
SET ORDER TO 1 DESCENDING

Thanks for the help...
Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top