Re: max of sum
From: MGFoster (me_at_privacy.com)
Date: 08/06/04
- Next message: MGFoster: "Re: Parameter Query keeps repeating itself..."
- Previous message: MGFoster: "Re: Telephone numbers"
- In reply to: Franky: "max of sum"
- Next in thread: M.L. Sco Scofield: "Re: max of sum"
- Reply: M.L. Sco Scofield: "Re: max of sum"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 06 Aug 2004 18:30:04 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
SELECT TOP 1 CustomerName, SUM(Tickets) As Total_Tickets
FROM table_name
ORDER BY 2 DESC
"order by 2 desc" means sort the output of the 2nd column in the SELECT
clause in descending order.
See the Access Help article on the TOP predicate for more info.
-- MGFoster:::mgf00 <at> earthlink <decimal-point> net Oakland, CA (USA) -----BEGIN PGP SIGNATURE----- Version: PGP for Personal Privacy 5.0 Charset: noconv iQA/AwUBQRPOKYechKqOuFEgEQJ3ygCaAihw46nh4ydQNjmEKkEG2PGN+XcAoP8m OcQAk0vc2jsIgu4vyFWVj9vK =C4UW -----END PGP SIGNATURE----- Franky wrote: > Hi all, > i need to filter out the customer who bought most tickets in an access db. I > have a query that gives me the total sum for each customer. But i can't > filter out just the best customer.
- Next message: MGFoster: "Re: Parameter Query keeps repeating itself..."
- Previous message: MGFoster: "Re: Telephone numbers"
- In reply to: Franky: "max of sum"
- Next in thread: M.L. Sco Scofield: "Re: max of sum"
- Reply: M.L. Sco Scofield: "Re: max of sum"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|