From: Rodrigo De León <rdeleonp@gmail.com>
To: Paul Lambert <paul.lambert@reynolds.com.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: Query design assistance - getting daily totals
Date: Wed, 12 Dec 2007 14:53:08 -0500
Message-ID: <a55915760712121153x5c9a10a1s89c737a44e4eb149@mail.gmail.com> (raw)
In-Reply-To: <475F8234.5090907@reynolds.com.au>
References: <475F3AAB.2050609@reynolds.com.au>
<20071212063142.GA26523@a-kretschmer.de>
<475F8234.5090907@reynolds.com.au>
On Dec 12, 2007 1:39 AM, Paul Lambert <paul.lambert@reynolds.com.au> wrote:
> It's a financial application which needs to work using a concept of
> 'financial periods' which may not necessarily correspond to calendar
> months and it's much easier to manage in this way than it is to merge it
> all together using a date field. Eg, 1st January may actually be the
> 15th 'working day' of the 9th 'financial period' - however looking at
> just a date of jan-1 there is no way of knowing this and it's the
> periods that matter more so than the actual date.
I think what you need is a Calendar Table to "map" actual dates to
"buckets" e.g. 'financial periods', etc. See:
http://codeinet.blogspot.com/2006/08/auxiliary-calendar-table-for-sql.html
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: rdeleonp@gmail.com, paul.lambert@reynolds.com.au
Subject: Re: Query design assistance - getting daily totals
In-Reply-To: <a55915760712121153x5c9a10a1s89c737a44e4eb149@mail.gmail.com>
* 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