Click here to Skip to main content
15,911,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have 1 table this is fallow:

ID Name DateofBirth
1. Amit 07.03.1987
2. Vikrant 20.01.1987


I want to write query this will return the output by Month.

This month have all friend name those have Birthday of this month.

I want to ouput like this:

ID Month Name
2. Jan Vikrant
1. March Amit


Please give me the query to get my output.

Thanks in Advance.
Posted

SQL
SELECT DateName(MONTH,ModifiedDate)AS 'Month', CName FROM TempData 

Try this one.
 
Share this answer
 
Have a look at this useful link here[^].
 
Share this answer
 
This will give you a month number. Look at DATENAME for text.
SELECT ID, MONTH(DateOfBirth), Name
FROM MyTable
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900