This is the "easy" query, qryEmployeeAttendenceBonuses, and here is the code that I started with:
SELECT [tblAttendence].[EmployeeNumber]
FROM tblAttendence
WHERE ((([tblAttendence].[WorkDay1Reason]) Is Null) And (([tblAttendence].[WorkDay2Reason]) Is Null) And (([tblAttendence].[WorkDay3Reason]) Is Null) And (([tblAttendence].[WorkDay4Reason]) Is Null) And (([tblAttendence].[WorkDay5Reason]) Is Null) And (([tblAttendence].[WorkDay6Reason]) Is Null) And ((Month([tblAttendence]![DateWeekStarting]))=Month(Now()-4)))
ORDER BY [tblAttendence].[EmployeeNumber], [tblAttendence].[DateWeekStarting] DESC;
I have one of the dumby employees with a missed day in the middle and both still come up. I need to add some extras to the query but I'm not sure how. The extra parameters are, if any of the WorkDayxReason entries is = to "HolD-A", accept that day(s) as a regular day worked. The next parameter is, is any WorkDayxReason is = to "VacD-A" or "JurD-A" to those days, usally a full week, should be ignored as thought it never exited in the calender. I actuality, I would really like this to age back 13 weeks instead of 4 months, but I haven't figured out how to work in weeks yet. On e last parameter, if "Bonus" appears the Emplyee is not elegable for a bonus that week. If anyone can help me out with the error of my query, it will be great;y appreaciated. Thanks amillion.
SELECT [tblAttendence].[EmployeeNumber]
FROM tblAttendence
WHERE ((([tblAttendence].[WorkDay1Reason]) Is Null) And (([tblAttendence].[WorkDay2Reason]) Is Null) And (([tblAttendence].[WorkDay3Reason]) Is Null) And (([tblAttendence].[WorkDay4Reason]) Is Null) And (([tblAttendence].[WorkDay5Reason]) Is Null) And (([tblAttendence].[WorkDay6Reason]) Is Null) And ((Month([tblAttendence]![DateWeekStarting]))=Month(Now()-4)))
ORDER BY [tblAttendence].[EmployeeNumber], [tblAttendence].[DateWeekStarting] DESC;
I have one of the dumby employees with a missed day in the middle and both still come up. I need to add some extras to the query but I'm not sure how. The extra parameters are, if any of the WorkDayxReason entries is = to "HolD-A", accept that day(s) as a regular day worked. The next parameter is, is any WorkDayxReason is = to "VacD-A" or "JurD-A" to those days, usally a full week, should be ignored as thought it never exited in the calender. I actuality, I would really like this to age back 13 weeks instead of 4 months, but I haven't figured out how to work in weeks yet. On e last parameter, if "Bonus" appears the Emplyee is not elegable for a bonus that week. If anyone can help me out with the error of my query, it will be great;y appreaciated. Thanks amillion.