The date field used from each table differs based on certain conditions that PHP is testing for. It would be great to have MySQL do that, but is that possible? Here's some additional info that might help. The first table includes fields Status, DateAdded, DateShipped, DateCompleted. If Status is Open, use DateAdded for Date. If Status is Processing, use DateShipped. If Status is Complete, use DateCompleted. The other 4 tables are similar. The results are being pulled from all 5 tables and collected by PHP. The goal is to sort all of the entries together for a report. This would be much easier if there were 5 seperate reports for each table. In this case, however, it's more handy to see all of the results in a single report and sorted by date. An example of a similiar situation would be an account register, if you store each type of transaction in it's own table and then end up wanting to create a bank reconcilliation report. Make sense? -Ed -----Original Message-----
> I used PHP to combine several MySQL queries into a single array and > now I'm trying to sort the results by one of the named columns. Any reason you can't turn all those queries into one and sort by date? Is it because a query like that would be too complicated for you? (I know I have trouble with SQL sometimes...) That might be the best way to solve your problem. Just an idea.