Re: still sorting and casting problems - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: still sorting and casting problems
Date
Msg-id 20020912065101.T45340-100000@megazone23.bigpanda.com
Whole thread Raw
In response to still sorting and casting problems  (juerg.rietmann@pup.ch)
List pgsql-sql
On Thu, 12 Sep 2002 juerg.rietmann@pup.ch wrote:

>
> Hello there
>
> Unfortunately, I can't change the fieldtype that easy because other
> applications use the date as char(10) field as well.
>
> 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
What do you get when trying this last query (something of the sort
works for me in 7.3beta).  It's possibly that you might need to use
date(log_date::text) desc, but without the error it's hard to say.




pgsql-sql by date:

Previous
From: "Gaetano Mendola"
Date:
Subject: Re: Select the max on a field
Next
From: Jeff Eckermann
Date:
Subject: Re: still sorting and casting problems