Avatar of frimy
Flag for United States of America

asked on 

Select only the maximum amount for each customer from a list MS 2010

I have list from all customers the daily open balance by date (I'm getting it from the Running Sum total).
I need to get only the largest Open Balance for any date for each customer.

I'm using created the following query.
It only works with little records.
But with a lot records I get an error "At most one record can be returned by this subquery"
Thanks in advance

MaxAmt: (SELECT top 1 [RunningSum ] FROM [qCustBal AddRunAmt] WHERE CustomerID=[Customer].[CustomerID] ORDER BY RunningSum Desc)
Microsoft Access

Avatar of undefined
Last Comment

8/22/2022 - Mon