Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Some Help Munipulating a Time Period in a Query!!

Status
Not open for further replies.

quest4

Technical User
Aug 27, 2001
735
US
Got it figured out, I think. A am almost home, but this is the part that killed it last time. I am lost to even start this, so here goes nothing, if JuryVacCount=>3 then GetNumWeeks()+1.
Reset GetNumWeeks() to default with when new EmployeeNumber.
What this in essense will do is allow en employee with a JuryVacCount=>3, in his 13 week period, to ignore that week and look at an extra week in its' place, in otherword, 14 weeks will realy be examined instead of the usual 13 weeks. Then when the next employee comes up the period is reset to 13 weeks, which is the default for GetNumWeeks(). I hope I made this clear enough? When this is done, I AM DONE AND OUT OF HERE and into testing. Thank you again for all of who help, I hope someone can show me the last ray of light. Here is the last part of the query:
IIf([JuryVacCount]<3,[DayCount]+[JuryVacCount], 0) AS PerfectDayCount
FROM tblEmployees AS Emp
LEFT JOIN tblAttendance AS Att
ON Emp.EmployeeNumber=Att.EmployeeNumber
WHERE (Emp.EmpStatusType=&quot;Active&quot; And Emp.PayType=&quot;per Hour&quot;)
And (Att.DateWeekStarting Between Nz([Enter Start Date],DateAdd(&quot;ww&quot;,-1-GetNumWeeks(),Date()))
And Dateadd(&quot;ww&quot;,GetNumWeeks(),Nz([Enter Start Date],DateAdd(&quot;ww&quot;,-1-GetNumWeeks(),Date()))))
ORDER BY Att.EmployeeNumber;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top