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?

2 Posts
1 Users
0 Reactions
1,059 Views
Posts: 46
Topic starter
(@Pavan NJ)
Joined: 6 years ago

Given Date is 10th October 


1 Reply
Posts: 36
(@Sandeep0069)
Joined: 6 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

Leave a reply

Author Name

Author Email

Title *

 
Preview 0 Revisions Saved
Share: