radox1 Posted July 18, 2011 Share Posted July 18, 2011 We are wanting to build a recent activity table in our website which will act as a timeline for recent orders. The current table id | order date | shipping date | declined date 1 11-01-11 19-01-11 2 13-01-11 14-01-11 3 15-01-11 16-01-11 4 15-01-11 15-01-11 The required output should be (sorted by most recent date date) 1 19-01-11 (shipped) 3 16-01-11 (shipped) 4 15-01-11 (shipped) 2 14-01-11 (declined) One way I have though to do this is add another field in the table 'updated date' and then simply sort by this. I am just wondering if there is a more efficient way? Link to comment https://forums.phpfreaks.com/topic/242251-sorting-by-multiple-dates-in-one-table/ Share on other sites More sharing options...
fenway Posted July 18, 2011 Share Posted July 18, 2011 Well, you could store a record with (orderID, date, type). Link to comment https://forums.phpfreaks.com/topic/242251-sorting-by-multiple-dates-in-one-table/#findComment-1244109 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.