Re: Number of days in a tstzrange? - Mailing list pgsql-sql

From skinner@britvault.co.uk (Craig R. Skinner)
Subject Re: Number of days in a tstzrange?
Date
Msg-id 20131030104015.GA12587@teak.britvault.co.uk
Whole thread Raw
In response to Re: Number of days in a tstzrange?  (skinner@britvault.co.uk (Craig R. Skinner))
Responses Re: Number of days in a tstzrange?  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
List pgsql-sql
On 2013-10-29 Tue 11:34 AM |, Craig R. Skinner wrote:
> 
>     -- if a subscription is ceased same day it's started,
>     -- that day is still chargable, so bump it
>     IF billable_days < 1
>     THEN
>         billable_days := 1;
>     END IF;
>     ...
>     ...
> 

This is more accurate:
-- If a subscription billing_period ends part way through a day,IF upper(billable_item.billable_period)::time <> time
'allballs'THEN   -- That partial day is still chargable, so bump it    billable_days := billable_days + 1;END IF;
 




pgsql-sql by date:

Previous
From: "M. D."
Date:
Subject: Re: Re: sum of until (running balance) and sum of over date range in the same query
Next
From: Gavin Flower
Date:
Subject: Re: Number of days in a tstzrange?