I have the following query:
SELECT distinct r.ERS_EMPNUM, r.LastName, r.FirstName, r.MiddleName,d.CheckDate, Count(Amount) as count_check, SUM(Amount) as total_check FROM Retirees r inner join EMPLOYEES d ON r.ERS_EMPNUM = d.ERS_EMPNUM GROUP BY r.ERS_EMPNUM, r.LastName, r.FirstName, r.MiddleName,d.CheckDate ORDER BY d.CheckDate DESC, r.ERS_EMPNUM
When this code is run, it displays among other things, total checks issued to an employee every two weeks and the total amount of those two checks.
This works great.
We would like to extend this code to produce how many checks are issued to each employee on 12 month calendar year and the total of those checks.
For instance, if 48 checks are issued, from Jan 2014 to December 2014, what is the total amount of those checks?
I have been stuck on this now for over two days.
Thanks a lot in advance.