Re: Given a set of daterange, finding the continuous range that includes a particular date (aggregates)

2018-02-28 Thread mariusz
hi, On Tue, 2018-02-27 at 16:15 -0800, Ken Tanzer wrote: > Hi. Thanks so much for your assistance. This is definitely getting > the results I was looking for. It is still syntacticallly more > cumbersome than I might have hoped, but I can work with it. So I've > got two follow questions/issue

Re: Given a set of daterange, finding the continuous range that includes a particular date (aggregates)

2018-02-27 Thread Ken Tanzer
Hi. Thanks so much for your assistance. This is definitely getting the results I was looking for. It is still syntacticallly more cumbersome than I might have hoped, but I can work with it. So I've got two follow questions/issues: 1) I can see there are many, more complex, options for aggrega

Re: Given a set of daterange, finding the continuous range that includes a particular date (aggregates)

2018-02-27 Thread mariusz
hello, one more fix, to not let someone get incorrect/incomplete ideas, see below On Tue, 2018-02-27 at 10:03 +0100, mariusz wrote: > On Fri, 2018-02-23 at 18:11 -0800, Ken Tanzer wrote: > > On Fri, Feb 23, 2018 at 6:10 AM, > > mariusz wrote: > > > > > >

Re: Given a set of daterange, finding the continuous range that includes a particular date (aggregates)

2018-02-27 Thread mariusz
On Tue, 2018-02-27 at 10:03 +0100, mariusz wrote: > On Fri, 2018-02-23 at 18:11 -0800, Ken Tanzer wrote: > > On Fri, Feb 23, 2018 at 6:10 AM, > > mariusz wrote: > > > > > > i guess, you can easily get max continuous range for each row > > with >

Re: Given a set of daterange, finding the continuous range that includes a particular date (aggregates)

2018-02-27 Thread mariusz
On Fri, 2018-02-23 at 18:11 -0800, Ken Tanzer wrote: > On Fri, Feb 23, 2018 at 6:10 AM, > mariusz wrote: > > > i guess, you can easily get max continuous range for each row > with > something like this: > > CREATE OR REPLA

Re: Given a set of daterange, finding the continuous range that includes a particular date (aggregates)

2018-02-23 Thread Ken Tanzer
> > On Fri, Feb 23, 2018 at 6:10 AM, mariusz wrote: > i guess, you can easily get max continuous range for each row with > something like this: > > CREATE OR REPLACE FUNCTION > append_daterange(d1 daterange, d2 daterange) > RETURNS daterange > LANGUAGE sql > AS >

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-23 Thread Ken Tanzer
On Fri, Feb 23, 2018 at 6:42 AM, Viktor Fougstedt wrote: > > Hi. > > This answer is perhaps useful if I understand your problem correctly. But > I might have interpreted it wrongly. :-) > > > I would probably start with merging intervals so that overlapping and > adjacent intervals become single

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-23 Thread Viktor Fougstedt
Hi. This answer is perhaps useful if I understand your problem correctly. But I might have interpreted it wrongly. :-) I would probably start with merging intervals so that overlapping and adjacent intervals become single continuous intervals, then select from those merged intervals. We hav

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-23 Thread mariusz
On Thu, 2018-02-22 at 17:23 -0800, Ken Tanzer wrote: > > > On Thu, Feb 22, 2018 at 5:05 PM, Adrian Klaver > wrote: > On 02/22/2018 04:58 PM, Ken Tanzer wrote: > > > > On Thu, Feb 22, 2018 at 4:53 PM, Adrian Klaver >

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-22 Thread Paul Jungwirth
On 02/22/2018 04:44 PM, Ken Tanzer wrote: Hi, hoping to get some help with this.  I'm needing to take a specific date, a series of dateranges  and, given a specific date, return a single conitinuous daterange that includes that date. The part about joining multiple touching dateranges to give

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-22 Thread Adrian Klaver
On 02/22/2018 09:05 PM, Adrian Klaver wrote: On 02/22/2018 05:23 PM, Ken Tanzer wrote: On Thu, Feb 22, 2018 at 5:05 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote:     On 02/22/2018 04:58 PM, Ken Tanzer wrote:     On Thu, Feb 22, 2018 at 4:53 PM, Adrian Klaver     mai

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-22 Thread Adrian Klaver
On 02/22/2018 05:23 PM, Ken Tanzer wrote: On Thu, Feb 22, 2018 at 5:05 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 02/22/2018 04:58 PM, Ken Tanzer wrote: On Thu, Feb 22, 2018 at 4:53 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-22 Thread Adrian Klaver
On 02/22/2018 05:23 PM, Ken Tanzer wrote: On Thu, Feb 22, 2018 at 5:05 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 02/22/2018 04:58 PM, Ken Tanzer wrote: On Thu, Feb 22, 2018 at 4:53 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-22 Thread Ken Tanzer
On Thu, Feb 22, 2018 at 5:05 PM, Adrian Klaver wrote: > On 02/22/2018 04:58 PM, Ken Tanzer wrote: > > >> >> On Thu, Feb 22, 2018 at 4:53 PM, Adrian Klaver > > wrote: >> >> On 02/22/2018 04:44 PM, Ken Tanzer wrote: >> >> Hi, hoping to get some help wit

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-22 Thread Adrian Klaver
On 02/22/2018 04:58 PM, Ken Tanzer wrote: On Thu, Feb 22, 2018 at 4:53 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 02/22/2018 04:44 PM, Ken Tanzer wrote: Hi, hoping to get some help with this.  I'm needing to take a specific date, a series of daterange

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-22 Thread Ken Tanzer
On Thu, Feb 22, 2018 at 4:53 PM, Adrian Klaver wrote: > On 02/22/2018 04:44 PM, Ken Tanzer wrote: > >> Hi, hoping to get some help with this. I'm needing to take a specific >> date, a series of dateranges and, given a specific date, return a single >> conitinuous daterange that includes that da

Re: Given a set of daterange, finding the continuous range that includes a particular date

2018-02-22 Thread Adrian Klaver
On 02/22/2018 04:44 PM, Ken Tanzer wrote: Hi, hoping to get some help with this.  I'm needing to take a specific date, a series of dateranges  and, given a specific date, return a single conitinuous daterange that includes that date. To elaborate a bit, I've got lots of tables that include sta

Given a set of daterange, finding the continuous range that includes a particular date

2018-02-22 Thread Ken Tanzer
Hi, hoping to get some help with this. I'm needing to take a specific date, a series of dateranges and, given a specific date, return a single conitinuous daterange that includes that date. To elaborate a bit, I've got lots of tables that include start and end dates. For example: CREATE TABLE