monthly birthday sql query

Solutions on MaxInterview for monthly birthday sql query by the best coders in the world

showing results for - "monthly birthday sql query"
Camilla
06 Oct 2018
1SELECT c.name
2FROM cust c
3WHERE (
4    MONTH(c.birthdate) = MONTH(@suppliedDate)
5    AND DAY(c.birthdate) = DAY(@suppliedDate)
6) OR (
7    MONTH(c.birthdate) = 2 AND DAY(c.birthdate) = 29
8    AND MONTH(@suppliedDate) = 3 AND DAY(@suppliedDate) = 1
9    AND (YEAR(@suppliedDate) % 4 = 0) AND ((YEAR(@suppliedDate) % 100 != 0) OR (YEAR(@suppliedDate) % 400 = 0))
10)
11