Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Compound Index
Message
From
15/08/1997 16:33:10
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
14/08/1997 01:37:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00044576
Message ID:
00045040
Views:
34
> > Hi all, > > I have a compound index on the following expression, > cnoee+DTOS(dtrans)+cdtrans where cnoee is Employee #, dtrans is date and > cdtrans is code. Is there any way I can do descending on dates but acending > on the others? Presently I can only think of using a large number to minus > DTOS(dtrans). Any other way? > > Thanks. Another old indian trick gives: Index on something+(str{01.01.2200}-cdtrans,4,0))+the_rest tag ... It works for next two centuries, and then you have to reingeneer the project :) Still, you might be better off by having three separate tags on the three fields, and when you need this specific order you select * from the_table into curs dummy; order by cnoee, dtrans desc, cdtrans If you need use the compound index to find the (date of) last occurence of a particular cnoee, you can simply set order to the_tag desce seek m.cnoee ....and you got the last record with cnoee=m.cnoee. Depending on what you need you may prefer one approach more than another, or invent something quite different. This is Fox, everything is feasible :)

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform