Functio to get Amount in words.

  • rbarryyoung (11/28/2008)


    Heh. Now that sounds like the ancient art of Wi-Yi-Yotta.

    😛

    You mean the one cherished by the "fugawie" tribe? :hehe:

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Mike C (11/28/2008)


    TheSQLGuru (10/14/2008)


    That site has a lot of really great stuff. Aaron Bertrand, IIRC.

    And I too think this is a presentation layer item. Or perhaps a CLR function??

    Actually something like this (precalculated and stored in a dimension table) might be useful for specialized BI applications. Of course when you get up into the billions and trillions, that's a whole lot of data to store 🙂

    I actually think that's the right track to take, but not necessarily to the extent of having ALL possible numbers spelled out. Consider this, in each number, no matter how big, the "triplets" of numbers are all spelled exactly the same way... only the suffix of each "triplet" changes (nothing, Thousand, Million, Billion, etc). I've seen one solution where a fellow calculate the word values for all triplets from 000 (no words) all the way up to 999. Only 1,000 rows of precalculated word values and the addition of the correct suffixes... it was nasty fast because each "triplet" was a simple, very direct lookup without all the outer joins, etc.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 2 posts - 46 through 46 (of 46 total)

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