Returning Month Name in SQL Server Query

后端 未结 11 1017
情深已故
情深已故 2020-12-13 03:39

Using SQL Server 2008, I have a query that is used to create a view and I\'m trying to display a month\'s name instead of an integer.

11条回答
  •  甜味超标
    2020-12-13 03:57

    This will give you the full name of the month.

    select datename(month, S0.OrderDateTime)
    

    If you only want the first three letters you can use this

    select convert(char(3), S0.OrderDateTime, 0)
    

提交回复
热议问题