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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set Order on multiple columns

Status
Not open for further replies.

acorbally

Programmer
Jan 9, 2001
65
US
I want to do a simple statment but it is not working. I am trying to do a "set order to mode, eff_date" for a table that has the following indexes:
INDEX ON eff_date TAG eff_date ADDITIVE
INDEX ON mode TAG mode ADDITIVE
When I do the set order to, it only orders mode not the mode and then eff_date, can anyone tell me why?
 
INDEX ON eff_date TAG eff_date ADDITIVE
INDEX ON mode TAG mode ADDITIVE
These statements are creating two separate indexes. One allows you to sort and search on eff_date, the other allows you to sort and search on mode. You need a third index to give you thge combined effect:
Code:
Index on Mode + Dtos(eff_date) Tag ModeDate
I'm assuming that Mode is a character variable so I'm using DTOS to convert the date into a yyyymmdd format string.

Geoff Franklin
 
Worked Great! Not sure how I missed it, I tried something similar and no luck. Thanks for your tip.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top