Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Looking for the oldest non-blank date
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01015389
Message ID:
01016045
Views:
15
>Sergey,
>
>>Your select looks fine to me but could use a couple of small changes. I prefer to use EMPTY() function and the replacement date in IIF is irrelevant as long as it is far in the future. It can be constant than.
SELECT AreaFK, StationFK, CrewFK, ;
>>	MIN(IIF(EMPTY(nextminor),{^9999/12/31}) AS NextMinor, ;
>>	MIN(IIF(EMPTY(nextmajor),{^9999/12/31}) AS NextMajor, ;
>>	.F. AS doMinGroup, .F. AS doMajGroup ;
>>	FROM premaint  GROUP BY 1,2,3  ORDER BY 1,2,3 ;
>>	INTO TABLE maintdue

>ISBLANK() vs. EMPTY() is one place where my dBase roots show. And the idea of using a constant will speed the execution time. Thanks for the code review; it's been helpful.

Tell you truth I never used ISBLANK() function in my code so it's easy choice for me. :)
I don't know if you get any noticable speed improvment with date constant vs expression but select with constant is easier to understand.
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform