Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Count of columns with value
Message
De
18/08/2008 07:05:58
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Count of columns with value
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01339464
Message ID:
01339464
Vues:
59
Hi
I want to get the count of the column with specific value.
In the following example Ihave to know how many columns with 'Y' (value can be 'Y' or empty)
create cursor mycursor (yellow c(1), grin c(1), blue c(1),total i)
insert into mycursor (yellow,grin,blue) values ('','Y','Y')
insert into mycursor (yellow,grin,blue) values ('Y','','Y')
insert into mycursor (yellow,grin,blue) values ('Y','Y','Y')
insert into mycursor (yellow,grin,blue) values ('','Y','')
insert into mycursor (yellow,grin,blue) values ('Y','','Y')
insert into mycursor (yellow,grin,blue) values ('','Y','Y')
insert into mycursor (yellow,grin,blue) values ('Y','','')

select mycursor
scan
	replace mycursor.total with ?&&count of columns with 'Y' value (0/1/2/3)
endscan
Thank you
Chaim
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform