• Here's a simple test for the floating point stuff. Works fine, fails safe, and drains to the bilge. 😛

    [font="Courier New"] SELECT STR(FLOOR(d.N*100)/100,4,2), COUNT(*)

       FROM (

             SELECT TOP 1000000

                    RAND(CHECKSUM(NEWID())) * 5 AS N

               FROM Master.dbo.SysColumns sc1

              CROSS JOIN Master.dbo.SysColumns sc2

            )d

      GROUP BY STR(FLOOR(d.N*100)/100,4,2)

      ORDER BY STR(FLOOR(d.N*100)/100,4,2)[/font]

    --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)