Use the query designer. In a total query, add an appropriate WHERE condition
(get the word WHERE in the GROUP line of the grid). A WHERE condition
eliminates records BEFORE the summation occur. The produced SQL code may
look like:
SELECT SUM(amount)
FROM myTable
WHERE itemNumber BETWEEN 0 AND [n]