Stephen Daugherty
asked on
LIMIT ROWS RETURNED IN ACCESS QUERY
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.CUS T_ID, TBL_D02_PROG_4_SUMMARY.NAM E1, Sum(TBL_D02_PROG_4_SUMMARY .QTY_ORDER ED) AS TOT_ORDERED, Sum(TBL_D02_PROG_4_SUMMARY .ORDER_TOT AL_PRICE) AS SUM_PRICE
FROM TBL_D02_PROG_4_SUMMARY
GROUP BY TBL_D02_PROG_4_SUMMARY.CUS T_ID, TBL_D02_PROG_4_SUMMARY.NAM E1
ORDER BY Sum(TBL_D02_PROG_4_SUMMARY .QTY_ORDER ED) DESC;
SELECT TBL_D02_PROG_4_SUMMARY.CUS
FROM TBL_D02_PROG_4_SUMMARY
GROUP BY TBL_D02_PROG_4_SUMMARY.CUS
ORDER BY Sum(TBL_D02_PROG_4_SUMMARY
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks matthewspatrick