How to get day of a week in SQL Server ?

Assume that you have a date “01/09/2016” and you would like to find out what day of the week it is. For example , it should display if it is Monday , Tuesday , Wednesday…

You can use the DATENAME function to get the day of a week as shown.

How to get day of a week in SQL Server ?

SELECT DATENAME(dw,GETDATE()) as day 

This will display Thursday as result.

image

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

When dealing with a relational database management system (RDBMS) like SQL Server, compatibility level is an important concept to understand....
In this blog post, let’s learn about the error message “49975 – Unable to load controller client certificate due to...
In this blog post, let’s learn about the error message “49973 – Cannot remove tempdb remote file to local tempdb...