Skip site navigation (1) Skip section navigation (2)

age() function usage

From: "Marcin Krawczyk" <jankes(dot)mk(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: age() function usage
Date: 2008-01-25 19:06:27
Message-ID: 95f6bf9b0801251106h6577fa94j508574db50030b53@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-sql
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 won't work, can anyone tell me the way to do it?

SELECT age(timestamp '1993-11-30') works great.
Same story with age(timestamp '2008-01-01', timestamp '1993-11-30').

Thanks in advance
mk

Responses

pgsql-sql by date

Next:From: Scott MarloweDate: 2008-01-25 19:41:15
Subject: Re: age() function usage
Previous:From: Frank BaxDate: 2008-01-25 17:43:10
Subject: Re: regex_replace problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group