Having trouble with Interval computation

From: "Jim Ballard" <jballard(at)netezza(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Having trouble with Interval computation
Date: 2001-07-16 15:44:03
Message-ID: 000801c10e0e$23951b70$8300a8c0@planet
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'd like to get the difference between two timestamp columns expressed as an interval with units "year to month." I believe the standard way to express this is as:

(timestamp1 - timestamp2) year to month

But this gives me a syntax error at "year". I also can't find a way to cast this to the desired interval units.

What is the proper way to express this in Postgres? Will the standard form be supported at some point?

Thanks very much,

Jim Ballard
jballard(at)netezza(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thalis A. Kalfigopoulos 2001-07-16 15:44:51 Re: How do i give comment for each Field
Previous Message Vince Vielhaber 2001-07-16 15:43:11 Re: html to postgres...