agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Gavin Flower <GavinFlower@archidevsys.co.nz>
To: Craig R. Skinner <skinner@britvault.co.uk>
To: pgsql-sql@postgresql.org
Subject: Re: Number of days in a tstzrange?
Date: Thu, 31 Oct 2013 07:21:50 +1300
Message-ID: <52714E3E.2080306@archidevsys.co.nz> (raw)
In-Reply-To: <20131030104015.GA12587@teak.britvault.co.uk>
References: <20131024204638.GA31094@teak.britvault.co.uk>
	<219E3855-325F-4B55-A23B-DA014FBDA2BF@excoventures.com>
	<20131029113450.GA26067@teak.britvault.co.uk>
	<20131030104015.GA12587@teak.britvault.co.uk>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

On 30/10/13 23:40, Craig R. Skinner wrote:
> 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;
>
>
>
even for 1 second over???

I would expect any court of law to set a higher threshold!


Cheers,
Gavin


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



view thread (5+ messages)

Message-ID: <52714E3E.2080306@archidevsys.co.nz>
Permalink:  ../52714E3E.2080306@archidevsys.co.nz/
Also on:    postgresql.org/message-id/52714E3E.2080306@archidevsys.co.nz

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: GavinFlower@archidevsys.co.nz, skinner@britvault.co.uk
  Subject: Re: Number of days in a tstzrange?
  In-Reply-To: <52714E3E.2080306@archidevsys.co.nz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox