Forum

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

How to Write a SQL Query to get all people born on the same day and month excluding the year?


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

Given Date is 10th October 

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

You have to use both day and month function. Try the below query. 

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

From Employees

Where Day(DateOfBirth)=10 AND Month(DateOfBirth)=10

Hope it helps. 

Reply

Self Learning Video Tutorials - Software Course

Leave a reply

Author Name

Author Email

Title *

 
Preview 0 Revisions Saved
Share: