Skip site navigation (1) Skip section navigation (2)

Re: Date / interval question

From: Gnugeek <gnugeek(at)comcast(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Date / interval question
Date: 2004-02-19 21:04:22
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql

I'm looking for a way, within SQL, given a starting date and an ending 
date, to get back the number of months between the start and end date. 
If I "SELECT end_date - start_date", I get back an interval in days; I 
need months.

Thanks for any suggestions,

In response to

pgsql-sql by date

Next:From: Brian KnoxDate: 2004-02-19 21:06:09
Subject: Re: DISTINCT ON troubles
Previous:From: Richard HuxtonDate: 2004-02-19 20:49:09
Subject: Re: Compiling pl/pgsql functions

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group