Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Birthdays this week
Message
 
 
To
19/03/2009 16:47:21
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01389309
Message ID:
01389782
Views:
32
>>
>>
>>select * from People where DOB between 
>>date(year(DOB), month(ldStart), day(ldStart)) and date(iif(year(ldEnd)>year(ldStart), year(DOB+1),year(DOB)), month(ldEnd), day(ldEnd))
>>
>>from the top of my head (not tested).
>
>This is similar to David's suggestion. On the other hand, I don't see how this code would be optimized, if Visual FoxPro has to extract the year() for every record to do the comparison. In other words, the expression on the left is a field, but the expression on the right is not constant.

Run it with SYS(3054,1) and index on the DOB and tell me the result.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform