Get the Weekday Name in SQL Server
There is a built-in function call DateName() in SQL Server to get the Weekday Name.
This function takes 2 parameters in which first is return date option whereas second one date value from which you want to get the weekday name.
To get the weekday name you have to specify the date option as 'dw'.
for example,
in output, it is give you week day name.
This function takes 2 parameters in which first is return date option whereas second one date value from which you want to get the weekday name.
To get the weekday name you have to specify the date option as 'dw'.
for example,
set dateformat dmy
SELECT DATENAME(dw,'09/03/2010') Weekday
in this example '09' is day of march. so if you use this sql function as i given above, it will return the exact name of the weekday.in output, it is give you week day name.
Comments
Post a Comment