Forum Replies Created

Viewing 15 posts - 286 through 300 (of 3,957 total)

  • RE: SUM OVER() coming up with different values than CTE query

    I tend to avoid the SUM() OVER and related functions for another reason.

    The Performance of the T-SQL Window Functions[/url]

    Except in cases where a query is really complex already and the...

  • RE: turning complex query into temp tables

    I don't really subscribe (generally) to the notion that breaking a query into separate pieces using temp tables makes it any easier to understand.

    To me, properly formatting the query to...

  • RE: Mortgage amortization table

    TomThomson (3/8/2015)


    Jeff Moden (3/1/2015)


    Solomon Rutzky (3/1/2015)


    Interestingly enough, nearly all of them were wrong in the exact same way. They all did their rounding at the presentation layer.

    I'm not so sure...

  • RE: How to Design, Build and Test a Dynamic Search Stored Procedure

    marcia.j.wilson (3/6/2015)


    Can't express my agreement strongly enough with the following:

    I really hate it when I have to wade through what I’d call “stream of consciousness” or write-only SQL. This...

  • RE: How to Design, Build and Test a Dynamic Search Stored Procedure

    lshanahan (3/6/2015)


    Timely repost. I was just creating my first-ever sp involving dynamic SQL this week when I saw this.

    My scenario wasn't nearly as complex, but this article (with appropriate...

  • RE: How to Design, Build and Test a Dynamic Search Stored Procedure

    omarlopez7 (3/6/2015)


    you can replace this part of the query

    "Last_Status_DT >= '2013-10-25'

    AND Last_Status_DT < '2013-10-29';"

    For this one

    "Last_Status_DT between '2013-10-25' and '2013-10-29';"

    And...

  • RE: Are the posted questions getting worse?

    SQLRNNR (3/6/2015)


    dwain.c (3/5/2015)


    SQLRNNR (3/5/2015)


    dwain.c (3/5/2015)


    Is it just that it's been so long that I haven't posted one, or does the Article Contribution Center (article editor) not play well with IE11?

    I...

  • RE: Are the posted questions getting worse?

    SQLRNNR (3/5/2015)


    dwain.c (3/5/2015)


    Is it just that it's been so long that I haven't posted one, or does the Article Contribution Center (article editor) not play well with IE11?

    I would say...

  • RE: Are the posted questions getting worse?

    Is it just that it's been so long that I haven't posted one, or does the Article Contribution Center (article editor) not play well with IE11?

  • RE: replace() remove the last character of some values

    Late to the party, but perhaps this does what you're looking for:

    WITH SampleData (s) AS

    (

    SELECT 'Admin -- Assistants'

    UNION ALL SELECT 'Finance --...

  • RE: find record(s) that exceed budget value

    I have the distinct impression that my under-caffeinated brain is missing something here, but can't you just skip the first step and do something like this?

    SELECT id, account, deposit, rtotal,...

  • RE: Mortgage amortization table

    Solomon Rutzky (3/4/2015)


    dwain.c (3/1/2015)


    Ah. I couldn't remember specifically what I was doing with respect to rounding. Mine was more a demonstration of the method, and I did not...

  • RE: Mortgage amortization table

    Greg Snidow (3/3/2015)


    dwain.c (3/1/2015)


    Thanks for saying it was an "excellent article" even with such discrepancies. 😀 Glad you felt like being generous today.

    Excellent article indeed Dwain. Especially from a...

  • RE: Query help. Previous using previous row

    To me this looks like a combination of a "data smear" and a running totals problem.

    Perhaps you'll find some ideas here:

    Filling In Missing Values Using the T-SQL Window Frame[/url]

  • RE: Tree View Hierarchy Query

    MaggieW (2/26/2015)


    Looks like you need to use recursive CTE. But I don't understand your question and your output requirement

    rCTEs are not the only way, and often aren't the fastest way:

    The...

Viewing 15 posts - 286 through 300 (of 3,957 total)