Last active
August 22, 2017 21:16
-
-
Save fwarren/8a3ee7a41a50855c2004dcd0128675c5 to your computer and use it in GitHub Desktop.
List Employee Birthdays and Anniversaries.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT e.LastName, e.FirstName, | |
CASE WHEN c.EmpGCstF1 = 1 THEN 0 ELSE 1 END AS 'Birthday', e.BirthDate, | |
CASE WHEN c.EmpGCstF2 = 1 THEN 0 ELSE 1 END AS 'Anniversary', e.HireDate | |
FROM Employee e | |
LEFT JOIN EmpCstFV c ON e.EmpUID = c.EmpUID AND c.CstID = 105 | |
WHERE e.CompanyID = 6 | |
AND e.TermDate IS NULL | |
ORDER BY e.LastName, e.FirstName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment