Forum

How to Write a SQL ...
 
Share:
Notifications
Clear all

How to Write a SQL Query to get all people born on given dates?

2 Posts
1 Users
0 Reactions
1,258 Views
Posts: 46
Topic starter
(@Rakesh)
Joined: 6 years ago

Dates are given here 01-Jan-2019 and 31-Dec-2019


1 Reply
Posts: 36
(@Sandeep0069)
Joined: 6 years ago

Use the date between function to achieve this.

 

Select Name, DateOfBirth, CAST(DateOfBirth as Date) as [DatePart]

From Employees

Where CAST(DateOfBirth) Between '2019-01-01' AND '2019-12-31'


Reply

Leave a reply

Author Name

Author Email

Title *

Preview 0 Revisions Saved
Share: