View Full Version : I only want records whose sum equals a field


sharrell
09-20-2002, 12:38 PM
Hi, guys.

I have a query in which I only want to return the most recent records until the sum matches a particular field.

For example, I have 7 of an item on hand. I want the query to return only receipts for the last 7.

Is this possible?

Thanks!

Fuga
09-20-2002, 05:58 PM
Are you saying that if you put 7 in a field, you want the query to return the 7 latest? if you put 5 in the field the query returns the 5 latest?

Fuga.

sharrell
09-23-2002, 05:07 AM
Actually, if I have 7 in a field I want it to pull the last receipts until the total received equals 7. If the last receipts don't equal exactly 7 (i.e. if most recent is 5 and the next is 3), I need it to return up to or greater than the amount on-hand.

I hope this makes sense.

Thanks!