There are two methods to find a day name from a date in SQL Server:
- DATENAME() Function
- FORMAT() Function
Using DATENAME
DECLARE @Date DATE = '2024-07-27'; SELECT @Date As [TDate], DATENAME(WEEKDAY, @Date) AS [Day_Name];
Using FORMAT
DECLARE @Date DATE = '2024-07-27'; SELECT @Date As [TDate], FORMAT(@Date, 'dddd') AS [Day_Name]