Re: [SQL] age() function usage

2008-01-25 Thread Marcin Krawczyk
Heh, that was easy, I must have been working for too long... :) Thanks 2008/1/25, Scott Marlowe <[EMAIL PROTECTED]>: > > On Jan 25, 2008 1:06 PM, Marcin Krawczyk <[EMAIL PROTECTED]> wrote: > > Hi all. I am trying to determine the way to pass a variable/field value > to > > an age() function, que

Re: [SQL] age() function usage

2008-01-25 Thread Scott Marlowe
On Jan 25, 2008 1:06 PM, Marcin Krawczyk <[EMAIL PROTECTED]> wrote: > Hi all. I am trying to determine the way to pass a variable/field value to > an age() function, query looks something like: > > SELECT age(timestamp data_zakonczenia_fakt) FROM kip_pracownicy_umowy WHERE > id_pracownika = 8 > > d

[SQL] age() function usage

2008-01-25 Thread Marcin Krawczyk
Hi all. I am trying to determine the way to pass a variable/field value to an age() function, query looks something like: SELECT age(timestamp data_zakonczenia_fakt) FROM kip_pracownicy_umowy WHERE id_pracownika = 8 data_zakonczenia_fakt being char column equal to say '1993-11-30'. Such approach

Re: [SQL] AGE function

2005-09-07 Thread Michael Fuhr
On Wed, Sep 07, 2005 at 08:24:54AM -0600, Michael Fuhr wrote: > On Tue, Sep 06, 2005 at 10:05:06PM -0700, Louise Catherine wrote: > > 1. How does postgre 7.3.3 calculate AGE function? > > 2. Why the result produced by postgre 7.3.3 > > is different from postgre 8.0.3 ? > > The change appears to h

Re: [SQL] AGE function

2005-09-07 Thread Tom Lane
Louise Catherine <[EMAIL PROTECTED]> writes: > When I execute this statement : > select AGE(TO_DATE('20041101','mmdd'), > TO_DATE('19991201','mmdd')) > at postgre 7.3.3, the result : > age > - > 4 years 11 mons 1 day With TimeZone set to 'Asia/

Re: [SQL] AGE function

2005-09-07 Thread Michael Fuhr
On Tue, Sep 06, 2005 at 10:05:06PM -0700, Louise Catherine wrote: > 1. How does postgre 7.3.3 calculate AGE function? > 2. Why the result produced by postgre 7.3.3 > is different from postgre 8.0.3 ? The change appears to have been committed in 7.4 and later in response to Bug #1332: http://arch

Re: [SQL] AGE function

2005-09-07 Thread A. Kretschmer
am 06.09.2005, um 22:05:06 -0700 mailte Louise Catherine folgendes: > When I execute this statement : > select AGE(TO_DATE('20041101','mmdd'), > TO_DATE('19991201','mmdd')) > ... > 4 years 11 mons 1 day > 4 years 11 mons > > My question : > 1. How does postgre 7.3.3 calculate AGE fu

Re: [SQL] AGE function

2005-09-07 Thread Louise Catherine
--- Michael Fuhr <[EMAIL PROTECTED]> wrote: > On Tue, Sep 06, 2005 at 10:05:06PM -0700, Louise > Catherine wrote: > > When I execute this statement : > > select AGE(TO_DATE('20041101','mmdd'), > > TO_DATE('19991201','mmdd')) > > > > at postgre 7.3.3, the result : > > age

Re: [SQL] AGE function

2005-09-06 Thread Michael Fuhr
On Tue, Sep 06, 2005 at 10:05:06PM -0700, Louise Catherine wrote: > When I execute this statement : > select AGE(TO_DATE('20041101','mmdd'), > TO_DATE('19991201','mmdd')) > > at postgre 7.3.3, the result : > age > - > 4 years 11 mons 1 day > >

[SQL] AGE function

2005-09-06 Thread Louise Catherine
When I execute this statement : select AGE(TO_DATE('20041101','mmdd'), TO_DATE('19991201','mmdd')) at postgre 7.3.3, the result : age - 4 years 11 mons 1 day at postgre 8.0.3, the result : age --- 4 years 11 mons