Received: from brelay.tatainfotech.com (PPP-200-4-72.bng.vsnl.net.in [203.200.4.72]) by postgresql.org (Postfix) with ESMTP id 4D0AA47587E for ; Wed, 17 Apr 2002 08:43:16 -0400 (EDT) Received: from blrmail.in.tatainfotech.com (IDENT:root@localhost [127.0.0.1]) by brelay.tatainfotech.com (8.11.0/8.11.0) with ESMTP id g3HCold05959; Wed, 17 Apr 2002 18:20:49 +0530 Received: from dsspntw34 ([163.122.5.65]) by blrmail.in.tatainfotech.com (8.9.3/8.9.3) with SMTP id SAA16806; Wed, 17 Apr 2002 18:15:18 +0530 Message-ID: <012801c1e60f$cbd86920$41057aa3@tatainfotech.com> From: "Gautham S. Rao" To: =?iso-8859-1?Q?St=E9phane_DEWITTE?= , References: Subject: Re: Need some help with dates Date: Wed, 17 Apr 2002 18:30:05 +0530 Organization: Tata Infotech Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Archive-Number: 200204/206 X-Sequence-Number: 7470 Hi Stéphane, Use, update mclis set cli_date = to_date(temp.temp1,'dd/mm/yyyy') Regards, Gautham. ----- Original Message ----- From: "Stéphane DEWITTE" To: Sent: Wednesday, April 17, 2002 6:03 PM Subject: [SQL] Need some help with dates > Hi. > > First, let me apologize for my poor level in english, I hope you'll > understand me. > > I'm new in PL/PgSQL, and I have a little problem. > > I have a temporary table (temp) with only varchar. I must do a request that > fill another table (mclis) with temp's data. But on the new tables, I have a > field in date format. When I make a > > update mclis > set cli_date = temp.temp1 > > he doesn't want because of the different formats ('column "cli_date" is of > type 'date' but expression is of type 'character varying'). > > In temp, my data are like 01/01/2001 > > I tried also > set cli_date = select case(temp.temp1 as date) but he says: > Cannot cast type 'character' to 'date' or Cannot cast type 'character > varying' to 'date'. > > Does anyone has an idea ? > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html >