Forum Replies Created

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

  • 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...

  • 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,...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • RE: The T-SQL Quiz

    > Found this to be quick and easy.

    And absolutely not SQL.

  • RE: Bankers Rounding

    Here is the mistake:

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

  • RE: The T-SQL Quiz

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

  • RE: The T-SQL Quiz

    Wait, it's not Friday afternoon yet.

    Too early for that query.

  • RE: First and/or Last Item different in Select

    You overcomplicated this.

    Added something which was not in my query:

    SELECT @QueryList = IsNull(@QueryList + Comparison , '') +

    '(' + ColumnName + ' ' +...

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