• Jeff Moden (5/3/2013)


    My biggest concern is the conversion to FLOAT to do the sum. FLOAT only has a precision of 15 significant digits. If you go any higher than that, you will start to get siginficant rounding errors without any warning.

    Use the appropriate datatype for these types of things. For most sums, FLOAT isn't it.

    Is it?

    Really?

    How about this one:

    SELECT ROUND(SUM(CONVERT(BIGINT, FPSTemp.amount))/100,2)

    ?

    Would make a good QoD: How many errors can you find in this piece of code?

    :hehe:

    _____________
    Code for TallyGenerator