How to Create an Index in Descending OrderLast reviewed: April 17, 1995Article ID: Q90412 |
The information in this article applies to:
SUMMARYBy default, indexes are created in ascending order (for example, alphabetically from A to Z) or by date from January to December. However, in some cases, there is a need to create an index in reverse (descending order such as alphabetically from Z to A) or by date from December to January. This article shows you how to create an index in descending order.
MORE INFORMATION
Numeric FieldsTo create a reverse index on a numeric field, create a value that is the difference between an arbitrary large value and the value being indexed. For example, if SALES is a numeric field in a database and MyIndex is an indexname, the following creates a reverse index on sales:
INDEX ON 10000000 - SALES TO MyIndex Date FieldsThe same principle applies to create a reverse index on a date field. If lastsale is a field in the database and MyIndex is an indexname, the following code creates a reverse index on the date field:
INDEX ON CTOD("01/01/2100") - lastsale TO MyIndex Character FieldsThe procedure to create a reverse index on a character field requires three steps:
Index on Two Fields [Field1 Ascending, Field2 Descending]To create an index on two fields where the first field is indexed in ascending order and the second field is indexed in descending order, refer to the character field example above. The same concept could apply to more than two fields. Follow Steps 1 and 2 above, and then Step 3 below:
|
Additional reference words: FoxDos 2.00 2.10 reverse
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |