In this post we will discuss how to get the weekday name in sql server 2008. Also you can check my previous posts on:
By using the DATEPART() function we can get the weekday name. The DATEPART() function is used to return a single part of a date or time, such as year, quarter, month, day, week, weekday, hour, minute, second, millisecond etc.
Here DATEPART() tooks two parameter like below:
DATEPART ( datepart , date )
date: valid date or datetime expression.
Below is the query that will return weekday name, like if today is friday it will return friday.
Declare @week int
Select case @week
When 1 then ‘Sunday’
When 2 then ‘Monday’
When 3 then ‘Tuesday’
When 4 then ‘Wednesday’
When 5 then ‘Thursday’
When 6 then ‘Friday’
You May Also like the Following SharePoint Online Tutorials:
Download FREE SharePoint 2019 Installation PDF Guide
This FREE PDF contains, Steps by step guide to install SharePoint 2019 Preview, prerequisites, hardware and software new features. First impression to SharePoint Server 2019 new modern site, modern lists and modern document libraries.