View Single Post
  #6  
Old December 1st, 2009, 07:21 PM posted to microsoft.public.access.queries
Roger Carlson
external usenet poster
 
Posts: 824
Default Top 3 by Sum of Value

On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "TopQuery.doc" which illustrates how to do this. You can
download it for free he
http://www.rogersaccesslibrary.com/f...ts.asp?TID=233

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L


"Opal" wrote in message
...
I am trying to create a query in Access 2003
that will give me the top 3 scrap parts by
value and I am getting stumped. I am trying
to build it as a sub-query....

SELECT ScrapData.Value, ScrapData.PartNo, ScrapData.Description
ScrapData.Date
FROM ScrapData
WHERE ScrapData.Value IN
(SELECT TOP 3 Sum(ScrapData.Value) AS SumOfValue
FROM ScrapData as Dupe
WHERE Dupe.PartNo = ScrapData.PartNo);

and I am getting 55 random records, not my top 3 by
sum....can someone please point me in the right direction?