oxicottin
Learning by pecking away....
- Local time
- Today, 18:35
- Joined
- Jun 26, 2007
- Messages
- 878
Hello, I have to calculate years of service for each employee to show the correct vacation they would get. I am calculating the [YearsOfService] from the current year and changing the employees start date to year which works except the first vacation you get after your first 6 months and the way I have it now it shows that person as 0.
YearsOfService: ([Forms]![frm_Switchboard]![cboYear])-Year([EmpDateOfHire])
Can I calculate [YearsOfService] by months that way the employee who is greater than 6 months can get the 1? If so how?
1 week Vac after six months of service
2 week Vac after (2) [YearsOfService]
3 week Vac after eight (8) [YearsOfService]
4 week Vac after fifteen (15) [YearsOfService]
5 week Vac after twenty-five (25) [YearsOfService]
YearsOfService: ([Forms]![frm_Switchboard]![cboYear])-Year([EmpDateOfHire])
Can I calculate [YearsOfService] by months that way the employee who is greater than 6 months can get the 1? If so how?
1 week Vac after six months of service
2 week Vac after (2) [YearsOfService]
3 week Vac after eight (8) [YearsOfService]
4 week Vac after fifteen (15) [YearsOfService]
5 week Vac after twenty-five (25) [YearsOfService]
SELECT tbluEmployees.EmpFName, ([Forms]![frm_Switchboard]![cboYear])-Year([EmpDateOfHire]) AS YearsOfService, IIf([YearsOfService]<=0,0,IIf(DateAdd("m",6,[YearsOfService])<=1,1,IIf([YearsOfService]<=7,2,IIf([YearsOfService]<=14,3,IIf([YearsOfService]<=24,4,IIf([YearsOfService]>=25,5)))))) AS acWeeksAquired
FROM tbluEmployees;