Skip to content

Instantly share code, notes, and snippets.

@fwarren
Last active August 22, 2017 21:16
Show Gist options
  • Save fwarren/8a3ee7a41a50855c2004dcd0128675c5 to your computer and use it in GitHub Desktop.
Save fwarren/8a3ee7a41a50855c2004dcd0128675c5 to your computer and use it in GitHub Desktop.
List Employee Birthdays and Anniversaries.
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