Re: datediff is there something like it?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Joel Fradkin <jfradkin(at)wazagua(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: datediff is there something like it?
Date: 2005-01-26 20:13:19
Message-ID: 20050126201319.GA23744@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Jan 25, 2005 at 10:11:40 -0500,
Joel Fradkin <jfradkin(at)wazagua(dot)com> wrote:
> Hi all working my way through our views and all is going very well.
>
> We use datediff in MSSQL a bit and I read about the field1::date -
> field2::date to return the days numerically.
>
> Is there any way to get months and years besides guessing days / 30 for
> months etc?

The age function will give a difference in years-months in addition to
days-hours-minutes-seconds.
Depending on what you want, it may not do exactly what you want.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Dennis Sacks 2005-01-26 20:57:32 Re: same question little different test MSSQL vrs Postgres
Previous Message Josh Berkus 2005-01-26 18:05:34 Re: working with multidimensional arrays in plpgsql