SQL Server Date Formats — ffffd

前端 未结 6 504
迷失自我
迷失自我 2021-01-13 19:11

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..

6条回答
  •  余生分开走
    2021-01-13 19:39

    You could use the DATENAME method to extract the day and then use the SUBSTRING to only take the first 3 chars.

    SELECT SUBSTRING(DATENAME(DW, '09/11/2009'), 1, 3)
    

提交回复
热议问题