Click here to Skip to main content
15,905,781 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My boss wants me to add a column to our SQL date dimension which converts our year_number (EX. "1996","1997" etc.) to the text spelling (EX. "Nineteen Ninety Six"). I have been looking stuff up but can't figure this one out.

Thank you!

What I have tried:

I tried DATENAME but it returns numbers.
Posted
Updated 18-Mar-19 18:15pm

 
Share this answer
 
Quote:
I have been looking stuff up but can't figure this one out.

I guess you have a little number of years to manage and you will need the convertion many times.
SQL is good at managing tables, why not create a table with 2 fields?
First field is numeric year, primary key.
Second field is the text spelling the year the way you want.
Fill the table manually.
Getting a conversion is a simple lookup.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900