• mballico (7/23/2014)


    To clarify the problem. The initial calculation is: Round (177673.74 * 0.21,2) = 37311.49

    Then I need to make the opening of each item and the corresponding calculation, which must match the sum to the initial calculation, but it gives 0.01 difference:

    Ítems; Valores; Round (Valores*0.21,2)

    Item 1; 9,495.18; 1,993.99

    Item 2 16,455.92 3,455.74

    Item 3 23,894.20 5,017.78

    Item 4 56,454.20 11,855.38

    Item 5 71,374.24 14,988.59

    37,311.48

    But I think there is no solution can only be set in any of the items the difference

    Rounding errors will occur in any scenario like this. It's not that SQL Server's ROUND() function has an issue, the use of rounding lends itself to rounding errors.

    http://www.investopedia.com/terms/r/rounding-error.asp

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?