Converting an int to an alphanumeric?

  • Hey ho people,

    I was wondering if there was a sql command which could convert a number to it's alphanumerical equivalent..

     

    ie 1 - ONE

    2 - TWO, etc etc

     

    Answers on a postcard!!

     

    Alex

  • AFAIknow there is no native, built-in command or function in MS SQL Server for this.

    U'd have to do the rick yourself. Create a mapping table in which link all the numbers to its 'alphanumeric' equivalents. Then try to come up with user-defined function that would convert a numeric input value to its equivalent.

  • This may be what you need :

    http://www.sqlservercentral.com/scripts/contributions/612.asp

  • thanks for the reply!

     

    i think im just gonna make a mapping table as it only has to be for a few numbers.

    cheers,

    alex

  • You might also have another search at the script section. There's a function called wordnumbers or something like that that will do exactly what you need without creating any permanent table. I just didn't have enough time to search for it.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply