Doyce,
It would be really simple if you looked at the LastReviewDate to find out if it was between X and Y number of days ago.
Regards,
Duane
Sent: Wednesday, September 12, 2018 12:25 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Employee Reviews Date Calculation
Dim Emonth As Integer
Dim Eday As Integer
Dim EYear As Integer
Dim Rdate As Date
Emonth = IIf(Month(Date) + 1 = Month([HDate]), Month([HDate]), IIf(Month([HDate]) > 6, Month([HDate]) - 6, Month([HDate]) + 6))
EYear = IIf(Month(Date) = "12" And Day(Date) > 15, Year(Date) + 1, Year(Date))
Eday = DatePart("d", [HDate])
Rdate = (DateSerial([EYear], [Emonth], [Eday]))
EffectiveDate = ([Rdate] + (8 - Weekday([Rdate])))
FROM (JobTitles RIGHT JOIN (Departments RIGHT JOIN Employees ON Departments.[DEPARTMENTID-1] = Employees.DEPARTMENTID) ON JobTitles.[JobTitleID-1] = Employees.JobTitleID) LEFT JOIN qrySupervisors ON Employees.SUPERVISORID = qrySupervisors.[EEID-1]
WHERE (((CDate(EffectiveDate(RHDate([Hiredate],[Re-hireDate])))) Between Date()+7 And Date()+14) AND ((Employees.Company)="XPO") AND ((Employees.EEStatus)="1") AND ((Employees.WageType)="H"))
ORDER BY Employees.LASTNAME, Employees.FIRSTNAME;
---In MS_Access_Professionals@yahoogroups.com, <duanehookom@...> wrote :
Hi Doyce,
Can you provide some significant table and field names? Can we assume you have a table of employees and a table of employee reviews?
Regards,
Duane
Sent: Wednesday, September 12, 2018 8:44 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Employee Reviews Date Calculation
Pros,
We do 2 employee reviews per year based on an employee's hire date. For example, if John was hired on 12/15/2008, in theory, he would get his next 2 reviews on 12/15/2018 and on 6/15/2019. He would also get a raise on the first Monday following a review. Let's call that date the effective date. I want to design a query that will select employee records that are due for a review. I want the records selected between 7 and 14 days. before the review date because I do this once per week and the supervisor's need time to do the review. I also need to calculate the effective date. What is the best approach to do this?
Doyce
Posted by: Duane Hookom <duanehookom@hotmail.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (4) |
Tidak ada komentar:
Posting Komentar