>>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 ...
>
Whoops, the second part of the WHERE should also have DTOS(datefield)+refield<="19991231".
>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