SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,466 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I have a date time field (date_in) 2021-09-15 11:12:58.2220000 and I would like to pull out the month only. I have created a column month(date_in) as date_in_month but the output is 1-12.
Any idea how I can see this as Jan - Dec please instead?
Check an example that uses FORMAT:
declare @date_in as datetime = '2021-09-15 11:12:58.222'
select @date_in, format(@date_in, 'MMM')