Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sum and count
Message
De
05/11/2013 10:00:36
 
 
À
05/11/2013 07:41:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01587291
Message ID:
01587300
Vues:
65
>hi all,
>
>i try this code to get result as 9 ,30.43,3,7
>but the result is 9,30,43,10,10
>
>SELECT column27,;
>              CAST(sum(IIF((column5>0)  , column5, 0)) AS N(14,2)) AS File3,;
>              CAST(sum(IIF((column8>0)  , column8, 0)) AS N(14,2)) AS File4,;
>              CAST(count(IIF((column5>0)  , column5, 0)) AS N(4)) AS File5,;
>              CAST(count(IIF((column8>0)  , column8, 0)) AS N(4)) AS File6;
>              FROM wtable2 ;
>GROUP BY column27;
>INTO CURSOR crsTest 
>index on padl(alltr(column27),10,"0")   tag aaa
>BROW NORMAL
>
Rick has given you the answer to your question, but I want to point out that you don't need the IIF() for the SUM() calculations. The result will be the same whether you add the zeroes in or not.

Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform