Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Looking for the oldest non-blank date
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000
Database:
Visual FoxPro
Divers
Thread ID:
01015389
Message ID:
01016045
Vues:
16
>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--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform