I hope someone will look at this and tell me why it is working as it is and how to correct it.
GetNumWeeks() AS TimePeriod,
IIf([JuryVacCount]<3,([DayCount]+[JuryVacCount]), 0)
AS PerfectDayCount,
IIf([JuryVacCount]>2,([TimePeriod]+1))
FROM tblEmployees AS Emp LEFT JOIN tblAttendance AS Att
ON Emp.EmployeeNumber=Att.EmployeeNumber
WHERE (Emp.EmpStatusType="Active"
And Emp.PayType="per Hour"
And (Att.DateWeekStarting Between Nz([Enter Start Date],DateAdd("ww",-1-TimePeriod,Date()))
And Dateadd("ww",TimePeriod,Nz([Enter Start Date],
DateAdd("ww",-1-TimePeriod,Date()))))
ORDER BY Att.EmployeeNumber;
The GetNumWeeks() is set to a default of 13 and insterad of picking it up, I get a pop-up window, so I enter manually 13 and with the one employeewho has a JuryVacCount>2, it creates a new column and puts the 14 there instead of listing 14 rows, and only lists only 13 rows. Why is it behaving like that? Why is is it not using TimePeriod? Thanks to anyone who answers this.
GetNumWeeks() AS TimePeriod,
IIf([JuryVacCount]<3,([DayCount]+[JuryVacCount]), 0)
AS PerfectDayCount,
IIf([JuryVacCount]>2,([TimePeriod]+1))
FROM tblEmployees AS Emp LEFT JOIN tblAttendance AS Att
ON Emp.EmployeeNumber=Att.EmployeeNumber
WHERE (Emp.EmpStatusType="Active"
And Emp.PayType="per Hour"
And (Att.DateWeekStarting Between Nz([Enter Start Date],DateAdd("ww",-1-TimePeriod,Date()))
And Dateadd("ww",TimePeriod,Nz([Enter Start Date],
DateAdd("ww",-1-TimePeriod,Date()))))
ORDER BY Att.EmployeeNumber;
The GetNumWeeks() is set to a default of 13 and insterad of picking it up, I get a pop-up window, so I enter manually 13 and with the one employeewho has a JuryVacCount>2, it creates a new column and puts the 14 there instead of listing 14 rows, and only lists only 13 rows. Why is it behaving like that? Why is is it not using TimePeriod? Thanks to anyone who answers this.