I need to get the day name from a given day and time using SQL Server 2008 R2.
An example :
This date:
'2014-11-14 00:00:00' '2014-11-15 00:00:00'
Expected Result:
Date Day Name of Date ---------------------------------- 2014-11-14 Friday 2014-11-15 Saturday
select DATENAME(weekday,getdate()) SELECT CONVERT(VARCHAR(10), '2014-11-14 00:00:00', 105) AS DATE, Datename(weekday, '2014-11-14 00:00:00') AS DayNameofDate
You need the DATENAME function. http://msdn.microsoft.com/en-us/library/ms174395.aspx