April 1, 2011 at 4:30 pm
Guys,
How can I extract Month from YYYYMM format?
Example: if I have 200602, Answer should be February.
Thanks
April 1, 2011 at 4:50 pm
Lookup substring in books online. If you really need the answer as February and not '02', then you are going to need to convert the period into a data - then use the datename function to get the weekday.
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
April 1, 2011 at 5:39 pm
select MonthName = datename(month,'200602'+'01')
Results:
MonthName
------------------------------
February
April 1, 2011 at 5:44 pm
Thank you Michael and Jeffrey!!! Michael's solution worked like a charm 🙂
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply