RE: Sorting by aggregate functions

2004-08-04 Thread James Smith
Never mind, sorting by Quantity did it.  I was sure I had already tried this with no results but hey... Sorry to waste all of your time. -- Jay > -Original Message- > From: James Smith [mailto:[EMAIL PROTECTED] > Sent: 04 August 2004 13:34 > To: CF-Talk > Subject: Sorti

Sorting by aggregate functions

2004-08-04 Thread James Smith
I have a situation where I need to sort a query by an aggregate function, ie: SELECT   d.ItemID, d.Title, sum(i.Quantity) AS Quantity FROM SomeTables GROUP BY d.ItemID, d.Title ORDER BY sum(i.Quantity) However this does not work and tells me I have an "Invalid use of group function".  So far