Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Proper index for date field
Message
From
22/01/2006 11:00:22
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
22/01/2006 10:40:06
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01089204
Message ID:
01089213
Views:
35
>Hi Jim,
>
>Yes, I am opening the view with NODATA.
>
>I only have a handful of deleted records and NO I do not have a tag on DELETED().
>
>If I add the index as expression = TTOC(xxx,1) or DTOS() would I not need to make the same changes to the where clause, or does it matter?
>
>TTOC(Account_debits.dtxndatetm,1) >= ttoc(DATETIME()-432000,1);
>
>Do the index expr and the use of it in the view not have to be in sync with each other for optimization? That is probably the part I do not "get".

They do. Specifically the use of it on the left of the operator has to match the index expression. The right side should be a constant, especially since datetime will return different values every second.

lcTTOC = ttoc(DATETIME()-432000,1)
select ...
where TTOC(Account_debits.dtxndatetm,1) = m.lcTTOC

>
>Thanks,
>John
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform