Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Group By Example in VFP 8
Message
From
21/07/2004 18:31:14
Luis Navas
Independent Consultant
Auckland, New Zealand
 
 
To
21/07/2004 18:23:46
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00926827
Message ID:
00926833
Views:
12
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 :-)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform