Problem with "Top N Value" Query



I followed/modified the "Criteria" in Microsoft KB Q153747 but do not
get the desired results. Instead of returning the Top-10 per Group
(LOC) I only get the Top-10 across all groups ... the same as if I use
the Top Values box in the query design tool bar.
Here is my SQL ... Any assistance is greatly appreciated!

SELECT [tbl_Short Lines by LOC].LOC, [tbl_Short Lines by LOC].PART,
[tbl_Short Lines by LOC].ITMDSG, [tbl_Short Lines by LOC].DSC,
[tbl_Short Lines by LOC].MPRODCAT_DSC, [tbl_Short Lines by LOC].[SHORT
LINES]
FROM [tbl_Short Lines by LOC]
WHERE ((([tbl_Short Lines by LOC].[SHORT LINES]) In (Select Top 10
[SHORT LINES] From [tbl_Short Lines by LOC] Where [LOC]=[tbl_Short
Lines by LOC].[LOC] Order By [SHORT LINES] Desc)))
ORDER BY [tbl_Short Lines by LOC].LOC, [tbl_Short Lines by LOC].[SHORT
LINES] DESC;

Thank you in advance.
Jeff

.



Relevant Pages

  • Re: How do I modify database criteria at formula level?
    ... cell. ... a third column calculating the min Loc for that PN ... a fourth column calculating the max Loc for that PN ... But I need to vary the criteria at the function level... ...
    (microsoft.public.excel.worksheet.functions)
  • RE: SQL Update query
    ... can we place 2 tables on the update clause. ... > We are having problems while updating one table based on certain criteria. ... > LOC ... > created for updating field is mentioned below ...
    (microsoft.public.sqlserver.mseq)
  • How do I modify database criteria at formula level?
    ... I would like to modify the criteria in the database functions DMIN and DMAX ... at the formula level, instead of by entering new value in criteria range cell. ... a third column calculating the min Loc for that PN ...
    (microsoft.public.excel.worksheet.functions)
  • Re: How do I modify database criteria at formula level?
    ... it never dawned on me that making "loc" as values solved part of my problem... ... cell. ... a fourth column calculating the max Loc for that PN ... But I need to vary the criteria at the function level... ...
    (microsoft.public.excel.worksheet.functions)