Forum Replies Created

Viewing 15 posts - 4,201 through 4,215 (of 6,037 total)

  • RE: Bankers Rounding

    Lynn, I'm not always right, but here I'm absolutely right.

    Try calculate 1./8 + 1./8 using your stupid rounding and tell me does it bring you right result.

    Because my way brings...

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    Cool!

    I'm now classified!

    REAL MONEY appears in final report, after FINAL rounding.

    The rule from math handbook:

    Convert your "real money" to money BEFORE you...

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    Jeff, don't blame SP4.

    Blame yourself.

    For implicit conversions you allow when you pass decimal number to float parameter.

    Run this and relax:

    select convert(float, 612.005), str(612.005,...

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    And for accounting and tax applications you must use accounting and tax data type: money, 4 digits after comma.

    Do presentation rounding AFTER last calculation is completed, as school math handbook...

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    If you run

    select round(1./3,2) + round(1./3,2) + round(1./3,2)

    result will be 0.99.

    No matter which rounding you gonna use.

    And re-read initial post:

    When dealing with large sets of scientific or statistical...

    _____________
    Code for TallyGenerator

  • RE: Select And Count Consecutive Numbers

    Antonio, you don't use #table explicitly in code, but it does not mean they are not used in your query.

    CTE just hides it behind the scene, yes, I agree, it's...

    _____________
    Code for TallyGenerator

  • RE: Select And Count Consecutive Numbers

    Jeff, there are no miracles.

    CTE with ranking is nothing else but #table with IDENTITY column. Don't you think?

    CTE just makes it looking familiar to OO programmers who quickly catch known...

    _____________
    Code for TallyGenerator

  • RE: Passing a Table to A Stored Procedure

    You welcome. It's good I bring some good mood to some good people.

    OK, I've got you point about client application.

    But, what kind of...

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    The whole idea of that rounding is wrong.

    > Over a large set of data, or when many subsequent rounding operations are performed as in digital signal processing, the round-to-even rule...

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    The numbers you are testing are not equally close to 0 or 10.

    Check it out:

    DECLARE @f float

    SET @f = 511.945

    SELECT @f

    SET @f = 512.945

    SELECT @f

    SET @f = 578.945

    SELECT @f

    SET @f...

    _____________
    Code for TallyGenerator

  • RE: Passing a Table to A Stored Procedure

    Eric, you need probably read some articles (including topic in BOL) about temp tables and table variables.

    Temp table is created in memory and stays there until it's too big. Then...

    _____________
    Code for TallyGenerator

  • RE: The T-SQL Quiz

    > Found this to be quick and easy.

    And absolutely not SQL.

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    Here is the mistake:

    ... Floor(Abs(@Temp + 0.5 * Sign(@p1)))

    _____________
    Code for TallyGenerator

  • RE: The T-SQL Quiz

    As one guy said (don't remember who and where ) "It depends"...

    _____________
    Code for TallyGenerator

  • RE: The T-SQL Quiz

    Wait, it's not Friday afternoon yet.

    Too early for that query.

    _____________
    Code for TallyGenerator

Viewing 15 posts - 4,201 through 4,215 (of 6,037 total)