How to convert the datetime value to nvarchar and want to format it "Month, Year" e-g October 1st 2009 value should get converted to "October, 2009"
use this:
select CONVERT(nvarchar(50),   DATENAME(m, getdate()) 
                               + ', ' 
                               + DATENAME(yyyy, getdate())
              )
OUTPUT:
--------------------------------------------------
October, 2009
(1 row(s) affected)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With