Forum

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

How to Write a SQL Query to get all people whose birth year is the same (2019,2020 e.t.c)


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

Any year like 2019 or 2020. 

I want to capture all people whose birth yer is the same from a table. Consider employee table. 

1 Reply
Posts: 36
Guest
(@Sandeep0069)
Eminent Member
Joined: 4 years ago

I choose in 2019 . You can also use In List to get both the year's data.

 

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

From Employees

where Year(DateOfBirth)='2019'

Reply

Self Learning Video Tutorials - Software Course

Leave a reply

Author Name

Author Email

Title *

 
Preview 0 Revisions Saved
Share: