X-Original-To: pgsql-sql@postgresql.org Received: from trade-india.com (ns5.trade-india.com [66.234.10.13]) by postgresql.org (Postfix) with SMTP id 6A163475AE5 for ; Mon, 17 Mar 2003 09:02:12 -0500 (EST) Received: (qmail 22766 invoked by uid 505); 17 Mar 2003 14:02:03 -0000 Received: from mallah@trade-india.com by ns5.trade-india.com by uid 502 with qmail-scanner-1.15 (uvscan: v4.1.60/v4171. Clear:. Processed in 1.653167 secs); 17 Mar 2003 14:02:03 -0000 Received: from mail-relay.trade-india.com (HELO system67.trade-india-local.com) (203.196.129.235) by ns5.trade-india.com with SMTP; 17 Mar 2003 14:02:01 -0000 From: Rajesh Kumar Mallah Organization: Infocom Network Limited To: Christoph Haller Subject: Re: Formatting intervals.. Date: Mon, 17 Mar 2003 19:32:45 +0530 User-Agent: KMail/1.5 Cc: jasiek@klaster.net, pgsql-sql@postgresql.org References: <3E75C7BE.5BFE8C6C@rodos.fzk.de> In-Reply-To: <3E75C7BE.5BFE8C6C@rodos.fzk.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200303171932.45934.mallah@trade-india.com> X-Archive-Number: 200303/393 X-Sequence-Number: 12432 Thank you, But i am bit confused. nevertheless i will be able to satisfy my customers. only last one question, how the truncate 9 mons 9 days to only month part ie 9 mons ? (i leave the serious discussion on you and Thomasz) regds mallah. On Monday 17 Mar 2003 6:33 pm, Christoph Haller wrote: > > > > > > 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 > > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > > -- Rajesh Kumar Mallah, Project Manager (Development) Infocom Network Limited, New Delhi phone: +91(11)6152172 (221) (L) ,9811255597 (M) Visit http://www.trade-india.com , India's Leading B2B eMarketplace.