How to Index a Field to Force Alpha Sort Before NumericID: Q122745
WINDOWS | MS-DOS | MACINTOSH | UNIX
The information in this article applies to:
SUMMARYThis article explains how to index a field sorted in ascending order and have alphabetic values listed prior to numeric values -- which is the opposite of what usually happens when values are sorted in ascending order.
MORE INFORMATIONThe following code creates an index on the customer table (located in the FoxPro directory and the tutorial subdirectory). The index uses the Address field to list the records in alphabetical ascending order, placing values that start with a number below values that start with a letter.
The IIF expression in the INDEX command places a pipe character (|) in
front of any value containing a number as the first digit. The pipe has a
higher ASCII value than any alphabetic character, so anything that begins
with a pipe is placed after entries that begin with a character. The pipe
character is only in the index; it is not in the table (data).
Additional reference words: FoxWin FoxDos FoxMac FoxUnix 2.60 2.60a KBCategory: KBSubcategory: FxprgBrowse
|
|
Last Reviewed: May 22, 1998 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |