Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Query to return all orders and their statuses


phirestarter

Recommended Posts

Hi there,

 

I'm trying to run a query on the database, that will return all orders already made, and all the statuses they went trough. I'm trying to calculate an average time that takes for an order to change from one status to another.

 

Thanks in advance for any help,

phire

Link to comment
Share on other sites

Here's one that pulls the info. You'll want the date the change was made, right? calculating the difference between the first and last mention of the order is up to you ;)

 

 

SELECT orders_id,orders_status_id,date_added FROM `orders_status_history` order by orders_id

 

Depending on your version of mysql, this should at least get you started.

What I mean is that the syntax might be slightly different for you but this works on mine.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...