the SUM of a Decimal value

  • if you are using SUM on a column of Decimal values.... it should bring you the full

    total just like any other typical SUM; correct?

    is there something i should watch out for?

    _________________________

  • watch out that the SUM doesn't overflow the field definition.

    take this simple example:

    field defined as decimal(3, 2)

    with values:

    1.01

    6.00

    4.00

    Summing these would produce 11.01, thus an overflow.

    So u may need to cast the values

    SELECT Sum(convert decimal(4, 2) decimalField)

  • many thanks 🙂

    i'll keep that in mind.

    _________________________

Viewing 3 posts - 1 through 2 (of 2 total)

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