from table a
where StatementDate = (Select max(Statmentdate) from table b where accountnumber = a.accountnumber)
Select allOpen in new window
from Accounts a inner join Statements S on a.accountNumber = s.AccountNumber
where s.statementDate = (Select max(StatementDate) from statements where accountNumber = a.Accountnumber
© 1996-2023 Experts Exchange, LLC. All rights reserved. Covered by US Patent
Open in new window
The results should be the last statement for each customer.