H
Hey
I have a report that should pick up individuals that have been absent
for 3-8 weeks. It should base this off the last date attended. I
formerly had "last" in the group field but it missed many records so I
changed to "max" and the correct individuals show. But when I add this
criteria in my [Date] field, I drop from 2846 records to 48. It is
omitting most of the records. Is there something wrong here?
<=DateAdd("ww",-3,Date()) And >=DateAdd("ww",-8,Date())
Here is the full statement if that helps:
SELECT tmpAttendance.PersID, Max(tmpAttendance.Date) AS MaxOfDate,
tmpAttendance.ClassID, tmpAttendance.Present, tblClasses.ClassName
FROM tmpAttendance INNER JOIN tblClasses ON tmpAttendance.ClassID =
tblClasses.ClassID
GROUP BY tmpAttendance.PersID, tmpAttendance.ClassID,
tmpAttendance.Present,
tblClasses.ClassName
HAVING (((tmpAttendance.ClassID)=28 Or (tmpAttendance.ClassID)=1 Or
(tmpAttendance.ClassID)=2 Or (tmpAttendance.ClassID)=3 Or
(tmpAttendance.ClassID)=4 Or (tmpAttendance.ClassID)=19 Or
(tmpAttendance.ClassID)=20))
ORDER BY tmpAttendance.PersID, Max(tmpAttendance.Date);
for 3-8 weeks. It should base this off the last date attended. I
formerly had "last" in the group field but it missed many records so I
changed to "max" and the correct individuals show. But when I add this
criteria in my [Date] field, I drop from 2846 records to 48. It is
omitting most of the records. Is there something wrong here?
<=DateAdd("ww",-3,Date()) And >=DateAdd("ww",-8,Date())
Here is the full statement if that helps:
SELECT tmpAttendance.PersID, Max(tmpAttendance.Date) AS MaxOfDate,
tmpAttendance.ClassID, tmpAttendance.Present, tblClasses.ClassName
FROM tmpAttendance INNER JOIN tblClasses ON tmpAttendance.ClassID =
tblClasses.ClassID
GROUP BY tmpAttendance.PersID, tmpAttendance.ClassID,
tmpAttendance.Present,
tblClasses.ClassName
HAVING (((tmpAttendance.ClassID)=28 Or (tmpAttendance.ClassID)=1 Or
(tmpAttendance.ClassID)=2 Or (tmpAttendance.ClassID)=3 Or
(tmpAttendance.ClassID)=4 Or (tmpAttendance.ClassID)=19 Or
(tmpAttendance.ClassID)=20))
ORDER BY tmpAttendance.PersID, Max(tmpAttendance.Date);