Re: Get days between two dates?

From: "Tovo J(dot) RABEMANANTSOA" <tovo(dot)rabemanantsoa(at)bordeaux(dot)inra(dot)fr>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Get days between two dates?
Date: 2011-01-31 16:29:46
Message-ID: 4D46E37A.4080802@bordeaux.inra.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 01/31/2011 04:50 PM, Emi Lu wrote:
> Good morning,
>
> Is there an existing method to get days between two dates?
>
> For example,
>
> select '2010-01-01'::date - '1999-10-12'::date
>
> Returns how many days.
>
> Thank you,
>
> --
> Lu Ying
>
Hi !
Yes there is : date '2001-10-01' - date '2001-09-28' returns integer '3'
(days) as said here :
http://www.postgresql.org/docs/8.4/interactive/functions-datetime.html

--
Tovo J. RABEMANANTSOA
INRA - UR1263 EPHYSE
71, Av. Edouard Bourlaux
F-33140 Villenave d'Ornon - France
Téléphone : +33 5 57 12 24 09

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Oliveiros d'Azevedo Cristina 2011-01-31 16:33:58 Re: Get days between two dates?
Previous Message Emi Lu 2011-01-31 15:50:43 Get days between two dates?