Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Only records up to a specific SUM() value?

Status
Not open for further replies.

admoore

IS-IT--Management
May 17, 2002
224
US
From a table of sales records, I need to select the most recent transactions by customer where the sum of those transactions is greater than $500; BUT, only enough records to meet the minimum sum requirement- not all of them.
So if a customer spent $150 once a month for the last year, I want to ONLY select the most recent 4 records...
If he spent $50 once a month, I'd need the most recent 10 records...

Ideas?

Thanks in advance...

-Allen M.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top