Forum Replies Created

Viewing 15 posts - 3,391 through 3,405 (of 4,087 total)

  • RE: top 80 percent from sum

    roryp 96873 (12/29/2011)


    If you want to get the top 80% of a cumulative sum of a numeric field, you have to do something like this (assuming you want them ordered...

  • RE: Format a Percentage

    You realize that this is a presentation issue and is best handled in the presentation layer.

    Drew

  • RE: Must be a better way?

    If I understood what you're trying to do, this is a more efficient approach.

    SELECT n.[ID], n.DisplayTime, n.NEText, c.Other_ID

    FROM @Case2 AS c

    CROSS APPLY (

    SELECT TOP (1) n.ID, n.DisplayTime, n.NEText

    FROM @Notes AS...

  • RE: Format a Percentage

    The problem occurs because of how the precision and scale of the result are determined from the precision and scale of the operand expressions. Check Precision, Scale, and Length...

  • RE: Order by in stored procedure

    GSquared (12/28/2011)


    I'd prefer to see the query that gets a syntax error, and fix that first, and then worry about optimization and standardization next.

    I don't think it's that easy to...

  • RE: Order by in stored procedure

    There may not be syntax errors, but there are lots of logical errors. For instance, the table clean_cust_account_lcd_cancel_switch is queried three separate times when it looks like it should...

  • RE: Split comma separate single row into multiple rows

    Jeff Moden has an article on this very subject. String Splitter[/url]

    Drew

  • RE: Data Spliting

    pdharmaraju (12/28/2011)


    use the loop and insert into new table

    It has been shown repeatedly that the loop performs much worse than the string splitter that was linked to previously in this...

  • RE: Complex Join (?) problem

    The problem with this query is that the order of the UOMs is not meaningful. It just happens that the UOM for capacity comes before the UOM for weight...

  • RE: Complex Join (?) problem

    stourault (12/22/2011)


    Also, I apologize, but I seem to have lost the formatting of the results set that I put in the post, I'm trying to figure out how to show...

  • RE: Help Finding Cumulative Daily Totals

    Jeff Moden has a very good article on exactly this problem. Solving the Running Total and Ordinal Rank Problems (Rewritten)[/url] Be sure that you follow all of the...

  • RE: Creating partially matched datasets

    Use NTILE() to divide each partition into two parts (control and experimental) and then use ROW_NUMBER() to assign a number to each record within the group and match corresponding numbers....

  • RE: Converting Rows into Columns

    angela.nira (12/22/2011)


    Is there an easy way? Any help you could provide would be greatly appreciated.

    We're all unpaid volunteers. We're more than willing to help as long as you've...

  • RE: SQL server 2005 and crystal report

    senthil_sn1 (12/22/2011)


    In ODBC the SQL language is English. The Regional settings is Japanese. This is settings in workstation. In the database server the regional settings is English

    This goes back to...

  • RE: Really Odd and Seemingly Difficult Update, One Piece of Data at a Time.

    ChrisM@home (12/21/2011)


    Secondly, use COALESCE(ExistingColumn, StagingColumn) like this to handle the NULL issue:

    ExistingColumn = COALESCE(ExistingColumn, StagingColumn)

    Actually it sounds like he wants to overwrite the existing column if both the existing and...

Viewing 15 posts - 3,391 through 3,405 (of 4,087 total)