To get the top 10 amounts for each ID, You might try a query whose SQL looks
something like this:
SELECT
[Your Table].[ID],
[Your Table].[AMT1]
WHERE
[Your Table].[AMT1] IN
(SELECT TOP 10
[Self].[AMT1]
FROM
[Your Table] AS [Self]
WHERE
[Self].[ID] = [Your Table].[ID])
Note there may be more or less than 10 records returned for each 10. There
will be less than 10 if there are fewer than 10 records in Your Table for
the ID. There may be more than 10 if the combination of ID and AMT1 is not
unique (that is, if there are "ties").
If you want to see the total amount for the ID in each record, create a new
query that joins the query above with your existing query on the ID field.
Randal said:
I have a query that is grouped by an ID and sums an amount field (AMT1). I
need to see the top 10 amount values for each ID. Is there a way to do this
in a single query? I need every ID and it's top 10 to show on a report.
Thanks,