Forum Replies Created

Viewing 9 posts - 1 through 9 (of 9 total)

  • Reply To: Replacing String Between Two HTML Tags

    jschmidt 17654 wrote:

    I did this exercise a few years ago. There were many, many combinations that caused problems, plus we had cases where the html markups were quoted in the text...

  • Reply To: Replacing String Between Two HTML Tags

    ScottPletcher wrote:

    ...hope you can work it out.

    You really need to provide truly representative sample data if you want a full solution.

    With the sample data thing, with this one it's incredibly...

  • Reply To: Replacing String Between Two HTML Tags

    ScottPletcher wrote:

    I think this is right.  Naturally you'll need to confirm for yourself, as I don't have any additional test data.

    IF OBJECT_ID('tempdb.dbo.#data') IS NOT NULL
    ...
  • Reply To: Replacing String Between Two HTML Tags

    ScottPletcher wrote:

    Could do this with recursion, from right to left, but for now I'll just do a simple cursor loop.  Hopefully that will perform well enough for what you need. ...

  • Reply To: Replacing String Between Two HTML Tags

    Hi Scott,

    Thanks for the quick reply - I'm just finishing for the day and I'll pick this up in the morning, at first glance it looks promising.

    Paul

  • RE: Date Range Consolidation Query

    Jeff Moden - Friday, March 15, 2019 6:52 PM

    It's an older article but still one of the best ways to do such...

  • RE: Identifing Gaps in Date Ranges

    I think this should do it

    ;

    WITH Category (CategoryID,PersonID,StartDate,EndDate)

    AS

    (

    SELECT ROW_NUMBER () OVER (PARTITION BY PersonID ORDER BY StartDate),PersonID,COALESCE(StartDate,'Jan 1, 1900'),COALESCE(EndDate, 'Jan 1, 2100')

    FROM ActiveCategory

    ),

    Cat2 (PersonID,StartDate,EndDate)

    AS

    (SELECT COALESCE(c1.PersonID,c2.PersonID), DATEADD(day,1,COALESCE(c1.EndDate,'Dec 31, 1899')),DATEADD(day,-1,COALESCE(c2.StartDate,'Jan 2,...

  • RE: Identifing Gaps in Date Ranges

    Hello Nevyn,

    I've worked through your solution now and it works in every situation but one (it's far better than what I came up with, I didn't think of using a...

  • RE: Identifing Gaps in Date Ranges

    Thanks for that mate, I'm just working through your solution but you are correct about the sample data being incorrect. I've updated the original post to reflect this.

    I'm 60% through...

Viewing 9 posts - 1 through 9 (of 9 total)