Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Count() in SQL??
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00128117
Message ID:
00128119
Vues:
20
>Good morning,
>
>I have a little SQL dilemma. I have a DO CASE...ENDCASE with 2 SQL queries per case, each going to a different cursor. My boss wants 2 record counts from the master table, based on 2 conditions. Is there any way to do that within one or both of the SQl statements??
>
>Example
>SELECT ass_l_ata,s_or_type FROM temp ;
>INTO TABLE cleared ;
>WHERE s_status = 'Cleared' ;
>ORDER BY ata
>
>lnClearedCount = RECCOUNT()
>
>SELECT ass_l_ata,s_or_type FROM temp ;
>INTO TABLE outstanding ;
>WHERE NOT s_status = 'Cleared' ;
>ORDER BY ata
>lnOutstandingCount = RECCOUNT()
>
>The conditions are set on the s_or_type field where I need to count 2 of the 3 possible types.
>
>Perry

If you just want to count then it's not necessarily to run SQL. It's enough to :
COUNT FOR s_status = 'Cleared' TO lnClearedCount
COUNT FOR NOT s_status = 'Cleared' TO lnOutstandingCount
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform