date interval - Mailing list pgsql-novice

From Keith Worthington
Subject date interval
Date
Msg-id 20050504202906.M2048@narrowpathinc.com
Whole thread Raw
Responses Re: date interval  (Frank Bax <fbax@sympatico.ca>)
List 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

pgsql-novice by date:

Previous
From: John DeSoi
Date:
Subject: Re: Output of PL/PGSQL?
Next
From: Frank Bax
Date:
Subject: Re: date interval