Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 10883476E73 for ; Wed, 8 Jan 2003 09:47:27 -0500 (EST) Received: from www.bowmansystems.com (unknown [65.169.9.144]) by postgresql.org (Postfix) with ESMTP id 63EAF476E39 for ; Wed, 8 Jan 2003 09:47:26 -0500 (EST) Received: from [10.0.3.3] (unknown [65.169.9.134]) by www.bowmansystems.com (Postfix) with ESMTP id 21AEBCA4F for ; Wed, 8 Jan 2003 08:44:21 -0600 (CST) Subject: to_date() confusion From: Richard Rowell To: pgsql-sql@postgresql.org Content-Type: text/plain Organization: Message-Id: <1042037339.25939.63.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.0 Date: 08 Jan 2003 08:49:00 -0600 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/97 X-Sequence-Number: 10962 I'm confused. How do I massage the integer 10102 into the date 2002-01-01? cmi=> select to_date('010102','MMDDYY'); to_date ------------ 2002-01-01 (1 row) cmi=> select to_char(10102,'000000'); to_char --------- 010102 (1 row) cmi=> select to_date(to_char(10102,'000000'),'MMDDYY'); to_date ------------ 2010-01-10 (1 row) TIA! -- Richard Rowell