I need the month+year from the datetime in SQL Server like 'Jan 2008'.
(我需要SQL Server中日期时间的月份+年份,如'2008年1月'。)
(我按月,年分组查询。)
(我搜索并找到了像datepart,convert等函数,但它们似乎都没有用。)
(我在这里错过了什么吗?)
(这有功能吗?)
select datepart(month,getdate()) -- integer (1,2,3...) ,datepart(year,getdate()) -- integer ,datename(month,getdate()) -- string ('September',...)
1.4m articles
1.4m replys
5 comments
56.9k users