Re: Potentially annoying question about date ranges (part 2)

From: "Guy Rouillier" <guyr(at)masergy(dot)com>
To: "PostgreSQL General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Potentially annoying question about date ranges (part 2)
Date: 2006-10-04 19:46:16
Message-ID: D4D1632DC736E74AB95FE78CD609007923B123@mtxexch01.add0.masergy.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice

Eberhard Lisse wrote:
> I receive payments, but not every day (or even every week),
> and I would like see how much I receive per week and/or per month. I
> also need to compare different years.
>
> I also would like to see what the (accumulated) sum of the payments
> is at the end of a given week, month.

Timestamp each transaction, then use a GROUP BY clause to aggregate the
numbers however you wish. If the available date field extractions are
not sufficient, write a scalar function of your own to accomplish what
you need.

--
Guy Rouillier

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2006-10-04 19:46:26 Re: storing transactions
Previous Message Talha Khan 2006-10-04 19:32:56 Re: storing transactions

Browse pgsql-novice by date

  From Date Subject
Next Message Shoaib Mir 2006-10-04 19:50:13 Re: Testing / debuging data import
Previous Message Tom Lane 2006-10-04 17:28:37 Re: restart error