Walter Meester
HoogkarspelPays-Bas
Information générale
Catégorie:
Codage, syntaxe et commandes
Kenny,
>The best way to overcome the speed problem, I have discovered, is to get rid of the UDF call and replace the logic with IIF()s and other native Foxpro functions imbedded in SQL statements.
>Problem: In order for this to work I have to be able to do a conditional count of records grouped by parent id and the COUNT(field_name) SQL function isn't working properly even with the correct GROUP BY and HAVING clauses.
>Question: Is there a native Foxpro function that anyone out there knows about that returns the # of records which meet a conditional parameter, kind of like:
>COUNT(Id, startdate >= DATE() AND enddate <= DATE()) AS numberactive,
Try: SUM(IIF(startdate >= DATE() AND enddate <= DATE(),1,0)) AS numberactive as a part of the SQL statement.
Hope it helps
Walter,
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement