>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--