Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Counting Values in a recordset
Message
 
 
À
28/03/2001 10:27:55
Todd Wolfe
Certified Marketing Services
Kinderhook, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00489422
Message ID:
00489443
Vues:
10
>Thank-you I have considered this but what do you do when you have 10-50 fields that need counting? Passing back the SQL statement 50 times could cause the report output to take and excessive amount of time to produce wouldn't it?

Another approach if you want to limit the number of SQL response is to use SUM() and the VFP IIF() function. Here is an example:
select sum(iif(field1 = value,1,0)) as cntField1, ;
   sum(field2 = value,1,0)) as cntField2 from test into cursor c_temp
If you have a lot of fields, the length of the SQL statement may be too large to send in one pass but you could break it up into smaller chunks.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform