How to Write a SQL Query to get all people born on the same day and month excluding the year?
Jul 28, 2020 6:51 am
Given Date is 10th October
Jul 28, 2020 10:58 am
You have to use both day and month function. Try the below query.
Select Name, DateOfBirth, CAST(DateOfBirth as Date) as [DatePart] From Employees Where Day(DateOfBirth)=10 AND Month(DateOfBirth)=10
Hope it helps.