Forum Replies Created

Viewing 15 posts - 2,281 through 2,295 (of 4,086 total)

  • RE: ranking query with nulls

    I think that this is what you are looking for.

    SELECT *, ROW_NUMBER() OVER(PARTITION BY Companyid, DateFrom ORDER BY DateTo DESC)

    FROM #temp

    ORDER BY CompanyID, DateFrom, DateTo

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: query and compare values in a text based column

    That's XML. You should be using the built-in XML functionality to shred the XML document. If you provide a more complete sample, we can help you with that.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Help with dynamic join with case statement

    Jeffery Williams (10/6/2016)


    I will give it a try thank you. AND I don't have to count I just need to know if the result is greater than 0. Basically...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Help with dynamic join with case statement

    Jeffery Williams (10/6/2016)


    I need to have a case statement in within a JOIN. The condition needs to be a SELECT,

    Basically I need to see if records exist that matches a...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Need Suggestion on How to work on Parsename command with dot or decimal?

    Simply replace the periods with something else before replacing the greater than sign with a period. It's up to you whether you restore the periods after the PARSENAME.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Add column value depending on other value in same row

    Have you tried Scott's approach?

    I also want to add that this violates 2nd Normal Form. Have you considered how you want to handle it when one of the codes gets...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Calculate time difference between two related visitors without using cursor

    valeryk2000 (10/5/2016)


    CELKO: Do not understand - is it about script from my post of Posted 9/27/2016 10:05:34 PM? This is just a result of query that I originally sent...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Are the posted questions getting worse?

    Hugo Kornelis (10/5/2016)


    drew.allen (10/5/2016)


    With my first article for SSC accepted for publishing, I've already written a second (unrelated) article. I'd like to have a couple of people review it.

    What...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: CONVERT DATETIME to TIME and remove seconds and milliseconds

    How about just changing the declaration of @StartTime2 to SMALLDATETIME?

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Are the posted questions getting worse?

    Luis Cazares (10/5/2016)


    Drew, congratulations on the article. I usually write the articles in Word and share them that way before publishing, then just copy and paste in the site.

    Thanks! I...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: DATE DIFF from previous row

    LAG (Transact-SQL)

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Are the posted questions getting worse?

    With my first article for SSC accepted for publishing, I've already written a second (unrelated) article. I'd like to have a couple of people review it.

    This article is meant...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Are the posted questions getting worse?

    Sean Lange (10/5/2016)


    drew.allen (10/5/2016)


    And now we're getting blatantly fraudulent spam. :angry:

    Is there any other kind? 😛

    Whatever the spam was it didn't last very long as I can't see it at...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Are the posted questions getting worse?

    And now we're getting blatantly fraudulent spam. :angry:

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to improve the efficiency of a conditional join

    It's really hard to provide suggestions without sample data and expected results based on that sample. (See the first link in my signature about how to provide that.)

    The main...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 2,281 through 2,295 (of 4,086 total)