Convert a date in words

2019-09-13 18:50发布

问题:

Hi am having a date like '01-01-2010' and i want to convert that date into words like

First January Twenty Thousand Ten

so how can i convert the date into words in tsql

回答1:

Using built-in method you can convert only month and day of week to string:

select DATENAME (month, GETDATE()), DATENAME (weekday, GETDATE()), 

returns:

January, Thursday

Other parts - impossible. You should roll a custom dictionary



标签: sql tsql date