S
shank
In the following query, my results are grouped by year.
How can I change this query to give me the top 5 values for each year?
Is that possible, or do I have to make individual queries for each year?
thanks!
SELECT DataTable.Year, DataTable.OrderNo, DataTable.Qty, DataTable.Cost,
DataTable.SellPrice, DataTable.Description
FROM DataTable
GROUP BY DataTable.Year, DataTable.OrderNo, DataTable.Qty, DataTable.Cost,
DataTable.SellPrice, DataTable.Description, DataTable.SingleArtist
HAVING (((DataTable.SingleArtist)="Yes"))
ORDER BY DataTable.Year, DataTable.SellPrice DESC;
How can I change this query to give me the top 5 values for each year?
Is that possible, or do I have to make individual queries for each year?
thanks!
SELECT DataTable.Year, DataTable.OrderNo, DataTable.Qty, DataTable.Cost,
DataTable.SellPrice, DataTable.Description
FROM DataTable
GROUP BY DataTable.Year, DataTable.OrderNo, DataTable.Qty, DataTable.Cost,
DataTable.SellPrice, DataTable.Description, DataTable.SingleArtist
HAVING (((DataTable.SingleArtist)="Yes"))
ORDER BY DataTable.Year, DataTable.SellPrice DESC;