How to Index a Combined Date and Character FieldLast reviewed: April 29, 1996Article ID: Q97066 |
The information in this article applies to:
To create an index on combined Date and Character type fields, you must break the Date type field into separate year, month, and day components; use the STR() function to connect the date pieces in the correct order; and then add the Character type field to the date string. You can use the following examples to create an index on combined Date and Character type fields (the INVOICES database is referenced in the examples):
INDEX ON STR(YEAR(idate))+STR(MONTH(idate))+STR(DAY(idate))+cno TO "date_cno.idx" -or- INDEX ON DTOC(idate, 1)+cno TO "date_cno.idx" -or- INDEX ON DTOS(idate)+cno TO "date_cno.idx"NOTE: The third example above applies ONLY to FoxPro versions 2.0 and later (including FoxPro for Macintosh), not to FoxBASE+.
REFERENCES"Microsoft FoxBASE+ Commands & Functions," page 4-22 "Microsoft FoxPro Language Reference," version 2.5, page L3-473
|
Additional reference words: VFoxWin 3.00 FoxWin FoxDos FoxMac 2.00 2.01
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |