>
> 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 :)