Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
More GROUP BY problems...
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
More GROUP BY problems...
Divers
Thread ID:
00892909
Message ID:
00892909
Vues:
44
I cannot figure out why my query is not grouping the way I expect (VFP8):
SELECT 0000000000+SUM(NVL(WeekShips.Shipped,0)) AS nShipped, ;
	0000000000+SUM(NVL(WeekSales.Sales,0)) AS WeekSales, ;
	0000000000+SUM(NVL(YTDSales.Sales,0)) AS YTDSales, ;
	ItemSetup.Retail, 0000000000+NVL(iciwhs.nOnHand,0) AS nOnHand ;
	FROM ItemSetup ; 
	INNER JOIN ItemSales ON ItemSetup.cItemNo = ItemSales.cItemNo ;
		AND ItemSales.Category = "TRANSFER" ;
	LEFT JOIN WeekShips ON WeekShips.cItemNo = ItemSetup.cItemNo ;
	LEFT JOIN WeekSales ON WeekSales.UnitRetail = ItemSetup.Retail ;
	LEFT JOIN IciWhs ON iciWhs.cItemNo = ItemSetup.cItemNo ;
	LEFT JOIN YTDSales ON YTDSales.UnitRetail = ItemSetup.Retail ;
	ORDER BY ItemSetup.Retail, nOnHand ; 
	GROUP BY ItemSetup.Retail, nOnHand ;
	HAVING YTDSales > 0 ;
	INTO CURSOR SpreadsheetResults
My resulting cursor has many records for each "retail" value! Any idea why?
Kogo Michael Hogan

"Pinky, are you pondering what I'm pondering?"
I think so Brain, but "Snowball for Windows"?

Ideate Web Site
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform