Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 47764476A1E for ; Thu, 12 Sep 2002 09:57:50 -0400 (EDT) Received: from web20806.mail.yahoo.com (web20806.mail.yahoo.com [216.136.226.195]) by postgresql.org (Postfix) with SMTP id 704874769EF for ; Thu, 12 Sep 2002 09:57:49 -0400 (EDT) Message-ID: <20020912135751.82100.qmail@web20806.mail.yahoo.com> Received: from [208.13.35.65] by web20806.mail.yahoo.com via HTTP; Thu, 12 Sep 2002 06:57:51 PDT Date: Thu, 12 Sep 2002 06:57:51 -0700 (PDT) From: Jeff Eckermann Subject: Re: still sorting and casting problems To: juerg.rietmann@pup.ch, pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/100 X-Sequence-Number: 9377 --- juerg.rietmann@pup.ch wrote: > I need to sort the query by the log_date desc > (log_date is char(10)). I > tried the following without success : > > select id, log_date from userlog order by cast > (log_date as date) desc > > select id, log_date from userlog order by > date(log_date) desc > > Please help and thank's in advance ... jr > You haven't shown the error message here, but I'm guessing that there is no direct cast between char and date available in PostgreSQL. Try casting first to text, then to date. __________________________________________________ Do you Yahoo!? Yahoo! News - Today's headlines http://news.yahoo.com