pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: skinner@britvault.co.uk
To: pgsql-sql@postgresql.org
Subject: Re: Number of days in a tstzrange?
Date: Wed, 30 Oct 2013 10:40:15 +0000
Message-ID: <20131030104015.GA12587@teak.britvault.co.uk> (raw)
In-Reply-To: <20131029113450.GA26067@teak.britvault.co.uk>
References: <20131024204638.GA31094@teak.britvault.co.uk>
	<219E3855-325F-4B55-A23B-DA014FBDA2BF@excoventures.com>
	<20131029113450.GA26067@teak.britvault.co.uk>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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;



-- 
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)  latest in thread

Message-ID: <20131030104015.GA12587@teak.britvault.co.uk>
Permalink:  ../20131030104015.GA12587@teak.britvault.co.uk/
Also on:    postgresql.org/message-id/20131030104015.GA12587@teak.britvault.co.uk

 · 

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: skinner@britvault.co.uk
  Subject: Re: Number of days in a tstzrange?
  In-Reply-To: <20131030104015.GA12587@teak.britvault.co.uk>

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

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