以字为单位转换日期 [英] Convert a date in words

查看:81
本文介绍了以字为单位转换日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好
的日期类似于'01 -01-2010'
,而我想将该日期转换为诸如

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

First 1月2万1千

First January Twenty Thousand Ten

所以我如何将日期转换为tsql中的单词

so how can i convert the date into words in tsql

推荐答案

使用内置方法,您只能将月份和星期几转换为字符串:

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

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

返回值:

January, Thursday

其他部分-不可能。您应该投放自定义词典

Other parts - impossible. You should roll a custom dictionary

这篇关于以字为单位转换日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆