Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group By Example in VFP 8
Message
De
21/07/2004 18:23:46
 
 
À
21/07/2004 18:19:25
Luis Navas
Independent Consultant
Auckland, Nouvelle Zélande
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00926827
Message ID:
00926829
Vues:
12
The GROUP BY must include all the fields in the SELECT that are not aggregate fields (SUM, AVG, etc).
GROUP BY Codpai, Codven, Valpedmn, Fecped, Nompai, Nomven
>Hi to all, can anyone give an example of how to perform this SELECT in VFP 8: I nknow i can make this work using Set EngineBehavior, but I want to use the correct way in VFP 8.
>Luis Navas
>
>
>Select Pedidos.Codpai, Pedidos.Codven, Pedidos.Valpedmn, Pedidos.Fecped, Maepai.nompai, Maeven.nomven, ;
>Iif(Month(fecped)=1,Sum(valpedmn),0) As enero, Iif(Month(fecped)=2,Sum(valpedmn),0) As Febrero, Iif(Month(fecped)=3,Sum(valpedmn),0) As Marzo, ;
>Iif(Month(fecped)=4,Sum(valpedmn),0) As Abril, Iif(Month(fecped)=5,Sum(valpedmn),0) As mayo, Iif(Month(fecped)=6,Sum(valpedmn),0) As junio,;
>Iif(Month(fecped)=7,Sum(valpedmn),0) As Julio, Iif(Month(fecped)=8,Sum(valpedmn),0) As Agosto,Iif(Month(fecped)=9,Sum(valpedmn),0) As septiembre,;
>Iif(Month(fecped)=10,Sum(valpedmn),0) As Octubre, Iif(Month(fecped)=11,Sum(valpedmn),0) As Noviembre, Iif(Month(fecped)=12,Sum(valpedmn),0) As diciembre ;
>From Pedidos ;
>Inner Join Maepai On Pedidos.Codpai=Maepai.Codpai Inner Join Maeven On Pedidos.codven=Maeven.codven ;
>Group By Pedidos.Codpai Where Pedidos.Fecped Between This.Cajafecha1.Value And This.Cajafecha2.Value Into Cursor (This.lcCursor) ReadWrite
>
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform