From: Tovo J. RABEMANANTSOA <tovo.rabemanantsoa@bordeaux.inra.fr>
To: pgsql-sql@postgresql.org
Subject: Re: Get days between two dates?
Date: Mon, 31 Jan 2011 17:29:46 +0100
Message-ID: <4D46E37A.4080802@bordeaux.inra.fr> (raw)
In-Reply-To: <4D46DA53.9050402@encs.concordia.ca>
References: <4D46DA53.9050402@encs.concordia.ca>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tovo.rabemanantsoa@bordeaux.inra.fr
Subject: Re: Get days between two dates?
In-Reply-To: <4D46E37A.4080802@bordeaux.inra.fr>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox