How do I get the day of the week (in ffffd format, so Mon, Tue etc.) in SQL ? I don\'t see anything about it in the CAST and CONVERT documentation..
For SQL Server 2012+:
SELECT FORMAT(GETUTCDATE(),'ffffd') AS ShortDayName
This is much cleaner than a substring solution. The FORMAT()
function can also be passed a culture for locale-aware formatting.
Note that this works for other date parts, such as month:
SELECT FORMAT(GETUTCDATE(),'MMM') AS ShortMonthName
FORMAT() Reference