How to Write a SQL Query to get all people born on given dates?
Jul 28, 2020 3:48 am
Dates are given here 01-Jan-2019 and 31-Dec-2019
Jul 28, 2020 10:48 am
Use the date between function to achieve this.
Select Name, DateOfBirth, CAST(DateOfBirth as Date) as [DatePart]
Where CAST(DateOfBirth) Between '2019-01-01' AND '2019-12-31'