Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group By Example in VFP 8
Message
De
21/07/2004 18:31:14
Luis Navas
Independent Consultant
Auckland, Nouvelle Zélande
 
 
À
21/07/2004 18:23:46
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:
00926833
Vues:
11
Thanks Craig, but in this way SELECT returnm me the same number of records as without the Group By Clause, before with Set Enginebehavior 70 and only writing codpai in the Group By it gives me 19, and writing what you told me it gives me 1410 Records.
Thanks for your time
Luis Navas
>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
>>
I never forget a face, but in your case I will make an exception :-)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform