Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Count - Why is this counting everything?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00102086
Message ID:
00102088
Vues:
16
Paul,

You're very close. Count simply gives you the number of records it encounters. What you put inside the parenthises may affect the performance but it certainly won't affect the result.

Try SUM(IIF(ISNULL(Table1.Rnum) > 0,1,0)) AS RnumTotal.

> Here's where I'm having problems. I'd like to count how many records have a value in the Rnum column (i.e. are not .NULL.). For this example, the total # should be 3. I've tried using:
>
>COUNT(IIF(LEN(Table1.Rnum) > 0,1,0)) AS RnumTotal
>
>But it keeps giving me the same number as the total number of records. What am I missing?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform