R
Ricter
I have the following SQL, stolen from another site, I wish to use to find
employee anniversary dates for the next year.
SELECT LastName, FirstName, HireDate, IIF(DateSerial(Year(Date() + 1,
Month(HireDate), Day(HireDate)) < Date() + 365, Year(Date() + 60) –
Year(HireDate), Year(Date()) – Year(HireDate))
AS YearsOfService
FROM tblEmployees
WHERE (DateSerial(Year(Date()), Month(HireDate), Day(HireDate))
BETWEEN Date() AND Date()) + 365 OR (DateSerial(Year(Date()) + 1,
Month(HireDate), Day(HireDate)) <= Date() + 365;
So, where do I put this?
employee anniversary dates for the next year.
SELECT LastName, FirstName, HireDate, IIF(DateSerial(Year(Date() + 1,
Month(HireDate), Day(HireDate)) < Date() + 365, Year(Date() + 60) –
Year(HireDate), Year(Date()) – Year(HireDate))
AS YearsOfService
FROM tblEmployees
WHERE (DateSerial(Year(Date()), Month(HireDate), Day(HireDate))
BETWEEN Date() AND Date()) + 365 OR (DateSerial(Year(Date()) + 1,
Month(HireDate), Day(HireDate)) <= Date() + 365;
So, where do I put this?