Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Indexing Question
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00291273
Message ID:
00291289
Views:
35
>I have a ledger detail table that lets say has 500,000 records. I have one index on the date field and reference field.
>
>Isn't there a way to select records for a given date range from this table without regard to the reference, quickly?
>
>I am finding that unless the search expression matches the index expression exactly this could be a slow process. Isn't it possible some way to "jump into" the table for a search routine at a particular date and then "jump out" of the search routine after a specific date since date is the first field of the index tag?

If your index tag is on DTOS(datefield)+reffield, then you should be able to do a select this way:

SELECT * FROM yourtable WHERE DTOS(datefield)+reffield>="19991001" AND DTOS(datefield)<="19991231" INTO ...

The left side of the "=" sign in the WHERE clause has to match the tag, but what's on the right side only has to match up to the point you're interested in.

HTH
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform