"tab view" <tabview(at)hotmail(dot)com> writes:
> When I do the following piece of SQL
> SELECT DISTINCT to_char(datetimelogged,'dd/mm/yyyy') AS datelogged FROM
> logins ORDER BY datelogged DESC;
> I don't seem to get the column sorted in date order.
I'd expect that to produce a textual sorting of the to_char strings.
> How do I force psql to use date order?
Sort by the underlying datetimelogged column, which I suppose is of
date or timestamp type ...
regards, tom lane