X-Original-To: pgsql-sql@postgresql.org Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by postgresql.org (Postfix) with SMTP id A6D15474E53 for ; Mon, 17 Mar 2003 08:04:05 -0500 (EST) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Mon Mar 17 14:03:58 2003 +0100 Received: œby rodos.fzk.de with ESMTP (8.8.6 (PHNE_17135)/8.7.1) id OAA06532; Mon, 17 Mar 2003 14:03:58 +0100 (MET) Message-ID: <3E75C7BE.5BFE8C6C@rodos.fzk.de> Date: Mon, 17 Mar 2003 14:03:58 +0100 From: Christoph Haller X-Mailer: Mozilla 4.77 [en] (X11; U; HP-UX B.10.20 9000/780) X-Accept-Language: en MIME-Version: 1.0 To: mallah@trade-india.com Cc: jasiek@klaster.net, pgsql-sql@postgresql.org Subject: Re: Formatting intervals.. Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit X-Archive-Number: 200303/391 X-Sequence-Number: 12430 > > > > Is it possible to customize interval display. > > > > eg, > > > > tradein_clients=# SELECT cast ('10-10-1999'::timestamp - '1-1-1999'::timestamp AS interval); > > +----------+ > > | interval | > > +----------+ > > | 282 days | > > +----------+ > > (1 row) > > > > can i display it in months and days.. > It doesn't make sense. You don't have whole date, so how long should > month be? 28? 29? 30? 31? > It does. As long the months between January and October are. So select age ('10-10-1999'::timestamp , '1-1-1999'::timestamp ) ; age --------------- 9 mons 9 days (1 row) Regards, Christoph