Question: I am running a query that is returning some summary data from a table in Access. I have built the query with the intentions of it driving an Access report, but I want to limit the rows returned to the first 20 rows. I have tried WHERE ROWNUM < 21, but plugging it into the SQL of the Access query does not work. What can I use here to limit the number of rows returned? This is running in Access and not ASP. The SQL is included below:
SELECT TBL_D02_PROG_4_SUMMARY.CUST_ID, TBL_D02_PROG_4_SUMMARY.NAME1, Sum(TBL_D02_PROG_4_SUMMARY.QTY_ORDERED) AS TOT_ORDERED, Sum(TBL_D02_PROG_4_SUMMARY.ORDER_TOTAL_P
RICE) AS SUM_PRICE
FROM TBL_D02_PROG_4_SUMMARY
GROUP BY TBL_D02_PROG_4_SUMMARY.CUST_ID, TBL_D02_PROG_4_SUMMARY.NAME1
ORDER BY Sum(TBL_D02_PROG_4_SUMMARY.QTY_ORDERED) DESC;