Click here to Skip to main content
15,909,440 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to get day of a specific date. I have a date stored in database e.g it is Dec 25th 2011. I want to check what day comes on 25th Dec..

Please help..

Thanks,
Asfand
Posted

select datename(dw,'25nov2011')
 
Share this answer
 
Comments
NetMan2012 29-Nov-11 7:46am    
Thanks alot. It works for me.
In query you can use datename() method

C#
string selectSQL = "select UPPER(name) as name,userid,day(dob) as da,DATENAME(month,dob) as mn,Designation,Deptt from empbirth where day (dob-1)= datepart(day, getdate()) AND month(dob)= datepart(month, getdate()) or day (dob-2)= datepart(day, getdate()) AND month(dob)= datepart(month, getdate())";
 
Share this answer
 
v2
Comments
uspatel 29-Nov-11 7:46am    
check updated 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