Forum

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

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


Posts: 47
Guest
Topic starter
(@Rakesh)
Eminent Member
Joined: 4 years ago

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

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

Self Learning Video Tutorials - Software Course

Leave a reply

Author Name

Author Email

Title *

Preview 0 Revisions Saved
Share: