From: Jeff Eckermann <jeff_eckermann@yahoo.com>
To: juerg.rietmann@pup.ch
To: pgsql-sql@postgresql.org
Subject: Re: still sorting and casting problems
Date: Thu, 12 Sep 2002 06:57:51 -0700 (PDT)
Message-ID: <20020912135751.82100.qmail@web20806.mail.yahoo.com> (raw)
In-Reply-To: <OF9F394F65.F3FC13C4-ONC1256C32.0036AAF4-C1256C32.00372D23@pup.ch>
--- 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jeff_eckermann@yahoo.com, juerg.rietmann@pup.ch
Subject: Re: still sorting and casting problems
In-Reply-To: <20020912135751.82100.qmail@web20806.mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox