My table has hundreds of lines for each Part_ID
I would like to return only the 6 most recent Order_Date for EVERY Part_ID
Part_ID Order_Date
ABC 4/31/08
ABC 11/5/07
ABC 6/3/07
ABC 10/1/06
ABC 8/4/06
ABC 5/5/05
XYZ 11/10/08
XYZ 4/3/02
etc. for EVERY Part_ID
I tried using Top N in Crystal group sort but it returned all rows for the Part_ID(s) having the Top 6 dates.
I'm open to using a SQL command
but where to add the most recent 6 for each Part_ID?
SELECT PART_ID, ORDER_DATE, ORDER_QTY
FROM MyTable
WHERE (PART_ID <> 'NULL')
ORDER BY PART_ID, ORDER_DATE DESC
TIA