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 Likes
405 Views
Rakesh
Posts: 47
 Rakesh
Guest
Topic starter
(@Rakesh)
Eminent Member
Joined: 2 years ago

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

1 Reply
Sandeep0069
Posts: 36
 Sandeep0069
Guest
(@Sandeep0069)
Eminent Member
Joined: 2 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: