Forum Replies Created

Viewing 15 posts - 1 through 15 (of 57 total)

  • RE: Using EXCEPT to Determine Row Differences

    I was going to report the same thing. The article should be updated to add rows to both tables, and to explain the usefulness of the joins, in restricting...

  • RE: T-SQL Help

    *facepalm* Sorry, I keep an eye on several forums, I forgot this one had that level of granularity....

  • RE: T-SQL Help

    Am I right in thinking your solution requires SS2012 ? Did we discuss that already ?

  • RE: T-SQL Help

    I would agree that there's some confusion, and the OP needs to clear it up. I worked based on the description of the task, and the sample data given...

  • RE: T-SQL Help

    There are four 'B' rows, the closed dates are:

    2013-08-15 00:00:00.000

    2013-08-02 00:00:00.000

    2013-09-03 00:00:00.000

    2013-12-01 00:00:00.000

    1970-01-01 00:00:00.000

    Three of those are on or after 2013-01-01. Ergo, my SQL is doing what the OP...

  • RE: T-SQL Help

    I did slog through it and found some bugs in what I had posted. I believe what I just posted, does return what he wants, and anticipates the possibility...

  • RE: Urgent help need to create query

    As far as I can see, the due day is either the starting day, or it's the next day, which is meant to be calculated, using that string value. ...

  • RE: Size of Query result set

    Assuming it's the network impact you care about, that's precisely the metric that matters. Your network does not care how hard SQL Server had to work to create the...

  • RE: Urgent help need to create query

    Yes, but the starting point is, which days fall under '3 days a week' or '8 times a month'. That's why I asked the OP to define business rules,...

  • RE: Urgent help need to create query

    Yes, you have missed the point. The join is easy. Parsing strings like '3 times a week' and 'daily' and 'every second Monday' and then deciding if that...

  • RE: T-SQL Help

    My solution did not work if either value was zero. This does:

    DECLARE @date datetime = '2013-01-01'

    ;WITH opened

    AS(

    SELECT [group], count(1) as [count] FROM #TempTable WHERE cast(createDate as date) <= @DATE...

  • RE: Need help with max value in date column

    It's a subquery and so it will affect performance. It's good practice to avoid subqueries where-ever possible. The approach I took, assumed you were looking for an aggregate...

  • RE: t-sql key on a table

    Thanks - good to know.

  • RE: t-sql key on a table

    I did not know that a clustered index is the default for a PK. Doesn't a clustered index mean the entire row is written in the index ?

  • RE: T-SQL Help

    lead/lag is awesome, I have 2012 🙂

    And I was wrong again. He's after a count, so I'm not sure how lead/lag help, esp as he wants to count two...

Viewing 15 posts - 1 through 15 (of 57 total)