Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Index on more than one field
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00017171
Message ID:
00017188
Views:
66
>>>Is is possible to create a primary index based on the combination of an integer field and a date field? If so, what is the proper syntax?
>>
>>Yes, you can use something like this.
>>
>>INDEX ON STR(FIELD1)+STR(FIELD2)... TAG MYTAG
>
>I think you might need to do DTOC(field2) for the date field?


yes, you should do the DTOC, but you should also be aware that the order of the file using this as an index will vary greatly depending on the date format being used! mmddyy, yymmdd, yyyymmdd, ddmmyy; see what im getting at!?

when necessary to create such an index, i usually (depending on need of the order being created) create a separate char field to mirror the date field with a format of yyyymmdd, this assures a descending order.
Lucien T. Elliott Programmer/Analyst
Staple Cotton CoOperative Association
416 West Market St | Greenwood | MS | 38930 | (662) 453 6231
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform