Re: [SQL] DateDiff in PostgreSQL

2003-11-09 Thread Yasir Malik
EMAIL PROTECTED] > Subject: [SQL] DateDiff in PostgreSQL > > > 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 o

Re: [SQL] DateDiff in PostgreSQL

2003-11-07 Thread Rod Taylor
> 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)

Re: [SQL] DateDiff in PostgreSQL

2003-11-07 Thread George A.J
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

Re: [SQL] DateDiff in PostgreSQL

2003-11-07 Thread Tomasz Myrta
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..

Re: [SQL] DateDiff in PostgreSQL

2003-11-07 Thread Yasir Malik
EMAIL PROTECTED] > Subject: [SQL] DateDiff in PostgreSQL > > > 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 o

[SQL] DateDiff in PostgreSQL

2003-11-07 Thread George A.J
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.. The - operator for timestamp retuns the intervel in days