In this article I am going to explain how to get month calendar with week day name in sql server.
In the previous article I have explained how to get the current month name withnumber of days in Sql server, how to get the number of days in current month inSql server , how to create autocomplete textbox using angularjs in asp.net mvcapplication, how to fill dropdownlist using AngularJs in MVC and how topopulate dropdownlist based on another dropdownlist using AngularJs in MVC.
To get month calendar with week day name run the below given query in Sql server:
declare @StartDate datetime
declare @Enddate datetime
set @StartDate = '20160601'
set @Enddate ='20160630'
;with dates as(
select @StartDate as sdt
select DATEADD(d,1,sdt) from dates where sdt<@Enddate
select ROW_NUMBER() OVER (ORDER BY sdt) AS [serial number], sdt as [Date], datename(dw,sdt)as [Week Day Name] from dates
What do you think about this article?
If you found this article useful, please share and follow on Facebook, Twitter, Google Plus and other social media websites. To get free updates subscribe to newsletter. Please put your thoughts and feedback in comments section.