Re: Query design assistance - getting daily totals - Mailing list pgsql-sql

From Rodrigo De León
Subject Re: Query design assistance - getting daily totals
Date
Msg-id a55915760712121153x5c9a10a1s89c737a44e4eb149@mail.gmail.com
Whole thread Raw
In response to Re: Query design assistance - getting daily totals  (Paul Lambert <paul.lambert@reynolds.com.au>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: "Gary Chambers"
Date:
Subject: Re: Query Assistance
Next
From: Richard Huxton
Date:
Subject: Re: Query Assistance