SQL Server Date Formats — ffffd

前端 未结 6 505
迷失自我
迷失自我 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:37

    I would use
    SELECT CONVERT(CHAR(3),DATENAME(weekday,GETDATE()))
    so as to avoid using another function in the SQL, the conversion to a CHAR(3) implicitly takes the first 3 characters.

    Jonathan

提交回复
热议问题