Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Date to Spell

user12050217Jun 10 2012 — edited Jun 10 2012
Hello,

Oracle 11.2.0.1
Windows xp

Is it possible to convert the dates into spell like this :

01/01/1982 should be First January Nineteen Eighty Two
02/01/1983 should be Second January Nineteen Eighty Three
03/02/1984 should be Third February Nineteen Eighty Four
04/03/1990 should be Fourth March Nineteen Ninety
05/04/2000 should be Fifth April Two Thousand
06/05/2001 should be Sixth May Two Thousand One
...
...

I read different links for this i.e.
select to_char(to_date(12345,'J'),'Jsp') from dual;
and 3650

But I am not able to convert the date into speaking words. I mean there will be a function in which I will call a sub function and then that will work something like this :
select myfunction('01/01/1982') from dual; and it will return the string based upon NLS_DATE parameter like this :
First January Nineteen Eighty Two

I am sure question has been asked, but not finding the link, kindly help me for link or function creation please.

We do not pronounce the 1981 as One Thousand Nine Hundred Eighty One, but we says Nineteen Eighty One, so its bit tricky to me. Getting month name is easy :
select to_char(sysdate, 'Month') from dual; but 31 days like first,second,third,fourth,fifth....Twenty Ninth, Thirtieth, Thirty First and Year part is tough for me.

Thanks.
This post has been answered by Solomon Yakobson on Jun 10 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 8 2012
Added on Jun 10 2012
5 comments
2,378 views