still sorting and casting problems

From: juerg(dot)rietmann(at)pup(dot)ch
To: pgsql-sql(at)postgresql(dot)org
Subject: still sorting and casting problems
Date: 2002-09-12 10:01:44
Message-ID: OF9F394F65.F3FC13C4-ONC1256C32.0036AAF4-C1256C32.00372D23@pup.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


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

Please help and thank's in advance ... jr

__________________________________________________

PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

internet : www.pup.ch
phone : +4141 790 4040
fax : +4141 790 2545
mobile : +4179 211 0315
__________________________________________________

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Ludwig Lim 2002-09-12 10:12:13 Re: reset sequence
Previous Message Oliver Elphick 2002-09-12 09:45:54 Re: how to cast this ?