X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 6B6CCB438A3 for ; Tue, 8 Jul 2003 20:45:20 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 47127-01 for ; Tue, 8 Jul 2003 17:45:09 -0300 (ADT) Received: from dbdevel.sunwave.net (h64-141-16-15.sunwave.net [64.141.16.15]) by svr1.postgresql.org (Postfix) with ESMTP id 529B6B438A2 for ; Tue, 8 Jul 2003 17:45:09 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by dbdevel.sunwave.net (Postfix) with ESMTP id 2B33F178008; Tue, 8 Jul 2003 16:45:05 -0400 (EDT) From: Michael A Nachbaur To: Yasir Malik , pgsql-sql@postgresql.org Subject: Re: Datatype conversion help Date: Tue, 8 Jul 2003 13:45:05 -0700 User-Agent: KMail/1.5 References: <1057695693.24179.0.camel@localhost> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200307081345.05009.mike@nachbaur.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/89 X-Sequence-Number: 14203 http://www.postgresql.org/docs/view.php?version=7.3&idoc=1&file=functions-formatting.html#FUNCTIONS-FORMATTING-DATETIMEMOD-TABLE See the pattern modifier "FM". From the docs: "FM prefix - fill mode (suppress padding blanks and zeroes)" On Tuesday 08 July 2003 01:28 pm, Yasir Malik wrote: > Thank you so much! But my problem is that when I do > to_char(mn, '00') || '-' || to_char(dy, '00') || '-' || to_char(yr, > '9999') > > where mn, dy, and yr are ints, is that the output has a space after the > the dash. For example, I get > 07- 25- 1994 > > instead of what I want: > 07-25-1994 > > Thanks, > Yasir > > On Tue, 8 Jul 2003, Richard Rowell wrote: > > Date: 08 Jul 2003 15:21:33 -0500 > > From: Richard Rowell > > To: Yasir Malik > > Subject: Re: [SQL] Datatype conversion help > > > > On Tue, 2003-07-08 at 15:07, Yasir Malik wrote: > > > I've tried to_char(in_val, '99'), and that returns a string that is two > > > > select to_char(9,'00'); > > ---------------------------(end of broadcast)--------------------------- > TIP 8: explain analyze is your friend -- /* Michael A. Nachbaur * http://nachbaur.com/pgpkey.asc */ "He expanded his chest to make it totally clear that here was the sort of man you only dared to cross if you had a team of Sherpas with you. "