Jump to content

Sorting by multiple dates in one table


radox1

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.