chrisuk Posted February 28, 2007 Share Posted February 28, 2007 Just noticed a funny thing with my sorts - this data is set to sort by Date Desc - notice how the morning ones are shown first, in decending order, then the afternoon, in descesnding order.... Any ideas? It's confused me somewhat. Date Logged 28 Feb 07 8:58am 28 Feb 07 8:56am 28 Feb 07 8:35am 28 Feb 07 13:14pm 27 Feb 07 13:45pm thanks Link to comment https://forums.phpfreaks.com/topic/40517-sorting-issue/ Share on other sites More sharing options...
magnetica Posted February 28, 2007 Share Posted February 28, 2007 Have you tried SORT BY Date ASC OR ORDER BY Date DESC See if either work Link to comment https://forums.phpfreaks.com/topic/40517-sorting-issue/#findComment-196049 Share on other sites More sharing options...
ashly Posted February 28, 2007 Share Posted February 28, 2007 Are you using any date format string in select statement like : to_char(date_field, 'dd-mm-yyyy') AS date_field_formatted if so , you have to use order by with 'date_field' not the 'date_field_formatted' Link to comment https://forums.phpfreaks.com/topic/40517-sorting-issue/#findComment-196054 Share on other sites More sharing options...
chrisuk Posted February 28, 2007 Author Share Posted February 28, 2007 currently set to: "SELECT * FROM `Issues` ORDER BY `logged_date` DESC"; as for the formatting... when an entry is made into the database the date is read from a variable and then inserted...ie: $sysdate = date("Y-m-d h:i:s"); "INSERT INTO Issues VALUES ('', '$sysdate'..etc") Link to comment https://forums.phpfreaks.com/topic/40517-sorting-issue/#findComment-196059 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.