Re: Subtraction of Dates

Поиск
Список
Период
Сортировка
От Steve Brett
Тема Re: Subtraction of Dates
Дата
Msg-id C05E7DA1218ED411BF8A00105AC95A8E0599DF86@sv-cntrmail.emis.local
обсуждение исходный текст
Ответ на Subtraction of Dates  ("Valerie Goodman" <VGoodman@aih.co.uk>)
Список pgsql-sql
try date_mi as opposed to direct subtraction.

eg:

edb=# select version();                           version
---------------------------------------------------------------PostgreSQL 7.0.3 on i686-pc-linux-gnu, compiled by gcc
2.95.2
(1 row)

edb=# select date_mi('2002-06-24','2002-06-21');date_mi
---------      3
(1 row)

Steve

> -----Original Message-----
> From: Valerie Goodman [mailto:VGoodman@aih.co.uk]
> Sent: 27 June 2002 14:22
> To: pgsql-sql@postgresql.org
> Subject: [SQL] Subtraction of Dates
> 
> 
> 
> When I want an integer for a number of days between two dates, direct
> subtraction of two dates returns an integer.
> 
> However, age function returns an interval.
> 
> Which is the correct method to use and if age is the correct 
> method, how do
> I convert that to the number of days?
> 
> 
> 
> 
> 
> ---------------------------(end of 
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://archives.postgresql.org
> 
> 




В списке pgsql-sql по дате отправления:

Предыдущее
От: Steve Brett
Дата:
Сообщение: Re: Function question
Следующее
От: Masaru Sugawara
Дата:
Сообщение: Re: Calculating with sql