Try ORDER BY SUM(PurchaseItem.Quantity)
----- Original Message -----
From: "Aidan Whitehall" <[EMAIL PROTECTED]>
To: "'DeVoil, Nick'" <[EMAIL PROTECTED]>; "CF-Talk (E-mail)"
<[EMAIL PROTECTED]>
Sent: Friday, July 28, 2000 9:54 AM
Subject: RE: Desperately need help - sorting a QueryNew()
> > There's no reason why you shouldn't be able to get it sorted
> > by the original
> > query.
> > Did you try "ORDER BY AmountSold" or "ORDER BY 2"?
> > What table(s) are Status and ShopUID on? What does Status=2 mean?
>
> AmountSold is a calculated column, created by:
>
> SUM(PurchaseItem.Quantity) AS AmountSold
>
> I've tried doing ORDER BY AmountSold but it just says
>
>
> ODBC Error Code = 07001 (Wrong number of parameters)
> [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
> Hint: The cause of this error is usually that your query contains a
> reference to a field which does not exist. You should verify that the
fields
> included in your query exist and that you have specified their names
> correctly.
>
>
> I guessed that was because AmountSold doesn't actually exist (ie it's the
> result of the aggregate function). So I tried ORDER BY
> SUM(PurchaseItem.Quantity) but that doesn't work either (hence resorting
to
> sorting the query after the event).
>
>
> As for ShopUID and Status, that just limits the query to completed orders
> (Status = 2) and the website the orders are related to (ShopUID).
>
>
> --
> Aidan Whitehall <[EMAIL PROTECTED]>
> Netshopper UK Ltd
> Advanced Web Solutions & Services
>
> http://www.netshopperuk.com/
> Telephone +44 (01744) 648650
> Fax +44 (01744) 648651
> --------------------------------------------------------------------------
----
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.