Hi,
You can use the age() function to find the difference between dates, and
use the extract() function to get the years, months, days, etc.
Yasir
On Fri, 7 Nov 2003, George A.J wrote:
> Date: Fri, 7 Nov 2003 05:34:09 -0800 (PST)
> From: George A.J <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Su
> ie, a function that returns difference of two dates(timestamp) in days
> or months or year..
>
> The - operator for timestamp retuns the intervel in days only.
rbt=# select extract('days' from current_timestamp -
'2003-01-01'::timestamp);
date_part
---
310
(1 row)
Yasir Malik <[EMAIL PROTECTED]> wrote:
>You can use the age() function to find the difference between dates, and>use the extract() function to get the years, months, days, etc.>Yasir
this will not work because age('25/12/1975','30/01/1986')wil return '10 year 1 month 5 days'
extract only returns
Dnia 2003-11-07 14:34, Użytkownik George A.J napisał:
Hi,
i am converting a MSSQL Server database to PostgreSQL.
Using PostgreSQL version 7.3.2.
Is there any function like the DateDiff() in MSSQL Server.
ie, a function that returns difference of two dates(timestamp) in days
or months or year..
Hi,
You can use the age() function to find the difference between dates, and
use the extract() function to get the years, months, days, etc.
Yasir
On Fri, 7 Nov 2003, George A.J wrote:
> Date: Fri, 7 Nov 2003 05:34:09 -0800 (PST)
> From: George A.J <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Su