Subject Help with query please
Author adele_leroux
Hi All, I would like to know if it is possible to write a select
query to be able to retrieve records from a single table where the
sum of the records does not exceed a certain amount. I know this
query is not going to work, but just to explain my problem to you I
will use this as an example...
SELECT UniqueID, MyLength
FROM MyTable
WHERE SUM( MyLength ) < 500

The result should be multiple records where the sum of all the
records returned does not exceed 500. If this is not possible by
using a select query, I would appreciate any input on how to
accomplish this without retrieving all the records from the database.

Thanks in advance,