Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GROUP BY Clause problem
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01058109
Message ID:
01058112
Views:
16
>I am getting an error that my GROUP BY Clause is in error or missing. Well, judging by the below, it is not missing, but may be invalid. Is there something obviously wrong with this GROUP BY? Do you have to also have an ORDER by with the GROUP BY in this case?
>
>
>	* The LOADING data is already filtered before it gets here.
>	SELECT ;
>			PRDPIFIL.X1 AS Three_Fours, ;
>			PADR(Loading.ProdCode, 15, "") AS Product_Code, ;
>			"01" AS Zero_One, ;
>			SUM(RIGHT(STR(Loading.Net),6)) AS Net_Weight, ;
>			PRDPIFIL.UM AS Unit, ;
>			SPACE(1) AS FILLER_1, ;
>			LEFT(Loading.Order, 6) AS Order_Number, ;
>			SPACE(8) AS FILLER_2, ;
>			PRDPIFIL.LOCN AS Location, ;
>			SPACE(9) AS FILLER_3, ;
>			Loading.Cust AS Customer, ;
>			SPACE(9) AS FILLER_4, ;
>			ThisForm.dShip AS cShipped_Date, ;
>			SPACE(7) AS FILLER_5, ;
>			ThisForm.BatchNo AS Batch_Number, ;
>			"IRL-PP" AS IRL_FILLER, ;
>			SPACE(4) AS FILLER_6, ;
>			ThisForm.ShippingUploadDate AS cShipUpload_Date, ;
>			ThisForm.ShippingUploadTime AS cShipUpload_Time ;
>		FROM ;
>			LOADING, ;
>			PRDPIFIL ;
>		WHERE ;
>			ALLTRIM(LOADING.ProdCode)==ALLTRIM(PRDPIFIL.PN) ;
>		GROUP BY ;
>			LOADING.Order + LOADING.Line, ;
>			Three_Fours, ;
>			Product_Code, ;
>			Zero_One, ;
>			Unit, ;
>			FILLER_1, ;
>			Order_Number, ;
>			FILLER_2, ;
>			Location, ;
>			FILLER_3, ;
>			Customer, ;
>			FILLER_4, ;
>			cShipped_Date, ;
>			FILLER_5, ;
>			Batch_Number, ;
>			IRL_FILLER, ;
>			FILLER_6, ;
>			cShipUpload_Date, ;
>			cShipUpload_Time ;
>		INTO TABLE E:\IRL\tmpShippedItems
>
>
You can't GROUP BY an expression (LOADING.Order + LOADING.Line).
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform