In
this article I am going to explain how to get week day name and month name of
current or given date in sql server.
Implementation:
To
get the week day name and month name of current date run the below given query
in Sql server:
declare @currentDate datetime
set @currentDate =
getdate()
select @currentDate as
Todaydate,datename(dw,@currentDate) as WeekDay,
datename(month,@currentDate) as MonthName,datepart(yyyy,@currentDate) as Year
Result:
To
get the week day name and month name for given date run the below given query
in Sql server:
declare @currentDate datetime
set @currentDate =
'20160101'
select @currentDate as
Todaydate,datename(dw,@currentDate) as WeekDay,
datename(month,@currentDate) as MonthName,datepart(yyyy,@currentDate) as Year
Result:
0 Comments