How to Write a SQL Query to get all people whose birth year is the same (2019,2020 e.t.c)
Any year like 2019 or 2020.
I want to capture all people whose birth yer is the same from a table. Consider employee table.
I choose in 2019 . You can also use In List to get both the year's data.
Select Name, DateOfBirth, CAST(DateOfBirth as Date) as [DatePart]