junction123
MIS
I need help in getting a date format as MMM-DDD-YYYY.
I tried Option 1 below but this gives me the format as DD-MMM-YYYY. I am able to copy and paste into excel and reformat into any date format.
Option 1
SELECT REPLACE(CONVERT(nvarchar(30),getdate(),106), ' ', '-')
I tried Option 2 below an dthis gives me the correct format, however, I am unable to reformat into any date format after copying and pasting into excel.
Option 2
select REPLACE(REPLACE(CONVERT(nvarchar(100), GetDate(), 107),' ','-'),',', '')
I tried Option 1 below but this gives me the format as DD-MMM-YYYY. I am able to copy and paste into excel and reformat into any date format.
Option 1
SELECT REPLACE(CONVERT(nvarchar(30),getdate(),106), ' ', '-')
I tried Option 2 below an dthis gives me the correct format, however, I am unable to reformat into any date format after copying and pasting into excel.
Option 2
select REPLACE(REPLACE(CONVERT(nvarchar(100), GetDate(), 107),' ','-'),',', '')