Help w Sql Query
Posted on 2014-12-14
I have a sql query and I need to add a piece of information to it which should be pretty easy for you experts!
The table in the query below (tblWorshipAttendance) has a record for each worship date. I want to show a field in the results that also tells me the last date they attended. The query right now tells me the persons name and how many times they attended during the year and I just want to add that last field that tells me the last time they attended.
SELECT tpm.FirstName, tpm.LastName, COUNT(twa.Contemporary1100) As AttendanceNos FROM tblPeopleMain tpm, tblWorshipAttendance twa WHERE twa.WorshipDate >= '01/01/2014' AND twa.WorshipDate <= '12/31/2014' AND Contemporary1100 = '1' AND tpm.RecordID = twa.PeopleID Group By tpm.LastName, tpm.FirstName