How to query for contiguous dates - DICOM

This is a discussion on How to query for contiguous dates - DICOM ; Without using a cursor, how can I query a table for contiguous dates My tables looks like this: Authorization StartDate EndDate 1 1/1/2008 1/2/2008 2 1/2/2008 1/3/2008 3 1/3/2008 1/4/2008 4 2/1/2008 2/2/2008 5 2/2/2008 2/3/2008 6 2/8/2008 2/9/2008 And ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: How to query for contiguous dates

  1. How to query for contiguous dates

    Without using a cursor, how can I query a table for contiguous dates

    My tables looks like this:

    Authorization StartDate EndDate
    1 1/1/2008 1/2/2008
    2 1/2/2008 1/3/2008
    3 1/3/2008 1/4/2008
    4 2/1/2008 2/2/2008
    5 2/2/2008 2/3/2008
    6 2/8/2008 2/9/2008

    And I want my query to return:

    StartDate EndDate
    1/1/2008 1/4/2008
    2/1/2008 2/3/2008
    2/8/2008 2/9/2008

    Thanks for your help.

    Archer

  2. Re: How to query for contiguous dates

    On Jun 16, 1:25*pm, wabag...@gmail.com wrote:
    > Without using a cursor, how can I query a table for contiguous dates
    >
    > My tables looks like this:
    >
    > Authorization * * StartDate * * * *EndDate
    > 1 * * * * * * * * * * *1/1/2008 * * * * *1/2/2008
    > 2 * * * * * * * * * * *1/2/2008 * * * * *1/3/2008
    > 3 * * * * * * * * * * *1/3/2008 * * * * *1/4/2008
    > 4 * * * * * * * * * * *2/1/2008 * * * * *2/2/2008
    > 5 * * * * * * * * * * *2/2/2008 * * * * *2/3/2008
    > 6 * * * * * * * * * * *2/8/2008 * * * * *2/9/2008
    >
    > And I want my query to return:
    >
    > StartDate * * * *EndDate
    > 1/1/2008 * * * * *1/4/2008
    > 2/1/2008 * * * * *2/3/2008
    > 2/8/2008 * * * * *2/9/2008
    >
    > Thanks for your help.
    >
    > Archer


    I think you intended to say "discontiguous dates" based on your
    desired end result. Assuming you're asking how you could do this using
    a DICOM C-Find query/matching type, the answer is you cannot, at least
    not in a single query.

  3. Re: How to query for contiguous dates

    On Jun 16, 8:25 pm, wabag...@gmail.com wrote:
    > Without using a cursor, how can I query a table for contiguous dates
    >
    > My tables looks like this:
    >
    > Authorization StartDate EndDate
    > 1 1/1/2008 1/2/2008
    > 2 1/2/2008 1/3/2008
    > 3 1/3/2008 1/4/2008
    > 4 2/1/2008 2/2/2008
    > 5 2/2/2008 2/3/2008
    > 6 2/8/2008 2/9/2008
    >
    > And I want my query to return:
    >
    > StartDate EndDate
    > 1/1/2008 1/4/2008
    > 2/1/2008 2/3/2008
    > 2/8/2008 2/9/2008
    >
    > Thanks for your help.
    >
    > Archer


    Your question is ambiguous but like goodalle I'll assume you want to
    perform a CFIND on a date range.
    For the example above, you need to pose 4 queries, passing each the
    study date range as a match key in the format
    yyyymmdd-yyyymmdd (20080101-20080401).



+ Reply to Thread