Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IIF in Select
Message
De
24/11/1998 15:51:11
 
 
À
24/11/1998 15:46:19
Carl Sarazin
Statistics Canada
Ottawa, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00161059
Message ID:
00161103
Vues:
25
>Thanks Mike for your reply.
>
>That would give me the number of occurences by grouping. Unfortunately it's a little more than that. What we're trying to do is (within one statement) get conditional counts for ranges. For instance, one count if the field is from 0 - 9, another if 10 - 19, etc. without having to generate a grouping indicator in advance. Ultimately we are trying to create a report with columns meeting certain criteria.

You can use UDF:
Select getcolumn(field1) As cField1, Count(*) as Counter ;
From MyTable ;
Group by 1

Function getcolumn
LParameter nField1
Do Case
Case nField1<10
Return "A"
Case nField1>=10 and nField1<20
Return "B"
....
EndCase
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform