Query - Last Record

  • Thread starter Thread starter DesperateDan
  • Start date Start date
D

DesperateDan

Guest
I have a query that contains a list of account numbers, payments, date of payments and account balance.

What I want to do is pull out the last account balance so this can be used on a statement.

Any ideas?

Thanks - Dan
 
Try this sort of thing

SELECT A.*
FROM Table1 A
INNER JOIN (SELECT Table1.AcctID, Max(Table1.EffDate) AS MaxOfEffDate
FROM Table1
GROUP BY Table1.AcctID) B
ON A.AcctID = B.AcctID
AND A.EffDate = B.MaxOfEffDate
 

Users who are viewing this thread

Back
Top Bottom