Show month as text

Bone_12 361 Reputation points
2021-11-03T12:10:06.887+00:00

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?

SQL Server
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
0 comments No comments
{count} votes

Accepted answer
  1. Viorel 119.7K Reputation points
    2021-11-03T12:37:59.787+00:00

    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')
    
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.