Forum Replies Created

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

  • RE: Recurrences

    Here is the dynamic sql approach:

    It returns the found datetimes including the previous and following rows (if present) using then sample data from the post before.

    DECLARE

    @query AS NVARCHAR(MAX),

    @queryWHERE AS NVARCHAR(MAX),

    @querySELECT...

  • RE: Recurrences

    Hello David,

    thanks for the script but the performance is truly poor...

    I decided do create a dynamic SQL Script :pinch: with, as you mentioned, LEAD() and LAG().

    This performs very...

  • RE: Recurrences

    Here you'll find some more sample data.

    For example the Grp value 421 is calculated several times.

    Thanks

    if object_id('tempdb..#tab1', 'U') is not null

    drop table #tab1;

    create table #tab1

    (

    ...

  • RE: Recurrences

    Hello David,

    this looks very promising, unfortunately sometimes the value Grp repeats itself on different datetime / item combinations.

    Thanks

  • RE: Recurrences

    Yes, this is my desired result. They don't need to be indicated by an ID.

  • RE: Recurrences

    yes

  • RE: Recurrences

    the value of 5 was meant as an example for the minimum number of recurrences with the same item

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