Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A8315476B3E for ; Wed, 8 Jan 2003 09:54:02 -0500 (EST) Received: from wolff.to (wolff.to [66.93.249.74]) by postgresql.org (Postfix) with SMTP id 00FC147684B for ; Wed, 8 Jan 2003 09:54:02 -0500 (EST) Received: (qmail 28191 invoked by uid 500); 8 Jan 2003 15:06:03 -0000 Date: Wed, 8 Jan 2003 09:06:03 -0600 From: Bruno Wolff III To: Richard Rowell Cc: pgsql-sql@postgresql.org Subject: Re: to_date() confusion Message-ID: <20030108150603.GB27870@wolff.to> Mail-Followup-To: Richard Rowell , pgsql-sql@postgresql.org References: <1042037339.25939.63.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1042037339.25939.63.camel@localhost> User-Agent: Mutt/1.3.25i X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/98 X-Sequence-Number: 10963 On Wed, Jan 08, 2003 at 08:49:00 -0600, Richard Rowell wrote: > I'm confused. How do I massage the integer 10102 into the date > 2002-01-01? > > cmi=> select to_char(10102,'000000'); > to_char > --------- > 010102 > (1 row) Note the leading space in the returned row. That is probably what is making the difference. You probably want to use to_char(10102,'FM000000').