date interval

From: "Keith Worthington" <keithw(at)narrowpathinc(dot)com>
To: "PostgreSQL Novice" <pgsql-novice(at)postgresql(dot)org>
Subject: date interval
Date: 2005-05-04 20:44:00
Message-ID: 20050504202906.M2048@narrowpathinc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi All,

I need to generate a column representing the interval passed in months and
restrict the returned data to those intervals matching 12, 24, 36 and 48.

So far by reading the documentation I have gotten to these expressions. But I
do not know how to get the number of months out of this.

current_date - tbl_detail.ship_by_date AS elapsed_x
age(tbl_detail.ship_by_date) AS elapsed_y

Once I get that I am thinking that I can use the same expression with the IN
to get the desired results.

Any help on the expressions would be appreciated.

Kind Regards,
Keith

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Frank Bax 2005-05-04 23:12:17 Re: date interval
Previous Message Bruno Wolff III 2005-05-04 19:32:35 Re: date update check