Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 4896A477210 for ; Mon, 6 Jan 2003 22:49:51 -0500 (EST) Received: from imf07bis.bellsouth.net (mail207.mail.bellsouth.net [205.152.58.147]) by postgresql.org (Postfix) with ESMTP id 9EB33475ADE for ; Mon, 6 Jan 2003 22:49:37 -0500 (EST) Received: from localhost.localdomain ([66.157.189.182]) by imf07bis.bellsouth.net (InterMail vM.5.01.04.19 201-253-122-122-119-20020516) with ESMTP id <20030107035135.LAKS23093.imf07bis.bellsouth.net@localhost.localdomain> for ; Mon, 6 Jan 2003 22:51:35 -0500 Subject: to_date confusion From: Richard Rowell To: pgsql-sql@postgresql.org Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.5 Date: 06 Jan 2003 21:58:35 -0600 Message-Id: <1041911915.2836.1.camel@workstation> Mime-Version: 1.0 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/176 X-Sequence-Number: 11041 I'm confused. How do I get the integer 10102 to come in as 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!