How to format datetime to MMM.YYYY format?

 Posted by Bandi on 6/30/2015 | Category: Sql Server Interview questions | Views: 580 | Points: 40
Answer:

SELECT REPLACE(RIGHT(CONVERT(VARCHAR(11),GETDATE() , 106), 8), ' ', '.') AS [Mon.YYYY] 


OutPut:
Mon.YYYY
Jul.2015


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response