Received: from mail.ipatimup.pt (peterpan.ipatimup.pt [194.65.114.74]) by postgresql.org (Postfix) with ESMTP id D5834475881 for ; Wed, 17 Apr 2002 11:07:37 -0400 (EDT) Received: from ipatimup.pt (localhost [127.0.0.1]) by mail.ipatimup.pt (8.11.6/8.11.6-IPATIMUP) with SMTP id g3HErrJ08767; Wed, 17 Apr 2002 15:53:53 +0100 X-RAV-AntiVirus: This e-mail has been scanned for viruses on host: mail.ipatimup.pt Received: from 195.23.103.182 (proxying for unknown) (SquirrelMail authenticated user miguel) by www.ipatimup.pt with HTTP; Wed, 17 Apr 2002 15:53:53 +0100 (WEST) Message-ID: <21044.195.23.103.182.1019055233.squirrel@www.ipatimup.pt> Date: Wed, 17 Apr 2002 15:53:53 +0100 (WEST) Subject: Re: Need some help with dates From: "Miguel Carvalho" To: In-Reply-To: References: X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal Cc: Reply-To: miguel@ipatimup.pt X-Mailer: SquirrelMail (version 1.2.2) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200204/212 X-Sequence-Number: 7476 > 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 > Convert your date from varchar to date, using the to_date function. ex: to_date('05 Dec 2000', 'DD Mon YYYY') Take a look at the formating functions available in Postgresql: http://www.postgresql.org/idocs/index.php?functions-formatting.html Regards Miguel Carvalho