Pravin Ghadge

Pravin Ghadge

  • 548
  • 2.1k
  • 581.9k

Show Datetime into Month Name And year format in SQL

Sep 27 2012 8:30 AM
Hi,

I want to shpw the datetime value in to Month Name And year format

For Eg:

26/09//12    =>Sep 2012


I have tried foll query also:
LEFT(DATENAME(mm, '26/09//12  '), 3) + '-' + RIGHT(CAST(YEAR('26/09//12  ') AS VARCHAR), 2)

But it is not working .
Kindly help me..


Answers (1)