aliikhlaq2006
Registered User.
- Local time
- Today, 13:44
- Joined
- Aug 10, 2017
- Messages
- 17
I need a result which displays the MAX date but its not working
I also try to run without the subquery "Datesw" and use field but not works for mePARAMETERS [Enter Month And Year (mm/yyyy)] Text ( 255 );
SELECT Advance.EmployeeID, Employees.Name, Advance.PayBack, (SELECT Sum(taken-payback) FROM advance SUB where employeeid=advance.employeeid and [Trdate]<=advance.Trdate) AS Balance, (SELECT Max(Trdate) FROM advance SUB where trdate=advance.Trdate) AS Datesw
FROM Employees INNER JOIN Advance ON Employees.ID = Advance.EmployeeID
GROUP BY Advance.EmployeeID, Employees.Name, Advance.PayBack, Format(Month([Trdate]),"00") & "/" & Year([Trdate]), Advance.Trdate
HAVING (((Format(Month([Trdate]),"00") & "/" & Year([Trdate]))=[Enter Month And Year (mm/yyyy)]))
ORDER BY Advance.EmployeeID, Advance.Trdate;