Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Order Value Per Country


douglaswalker

Recommended Posts

Hi there

I am looking for a way to pull order values for a particular county (New Zealand) between a set of dates.

Ultimately I would like to create a report in admin but for now does anyone know or point me toward an SQL statement I could run against the database.

many thanks

Doug :thumbsup:

Link to comment
Share on other sites

select sum(value) from orders_total ot, orders o where ot.orders_id = o.orders_id and o.delivery_country = 'New Zealand' and ot.class = 'ot_total' and o.date_purchased between '2016-01-01 00:00:00' and '2017-12-31 23:59:59'

Depends on what you named 'New Zealand' of course :smile:

osCommerce user since 2003! :thumbsup:

Link to comment
Share on other sites

6 hours ago, frankl said:

select sum(value) from orders_total ot, orders o where ot.orders_id = o.orders_id and o.delivery_country = 'New Zealand' and ot.class = 'ot_total' and o.date_purchased between '2016-01-01 00:00:00' and '2017-12-31 23:59:59'

Depends on what you named 'New Zealand' of course :smile:

Hey thanks so much.. Works like a charm.:biggrin:

Does ot_total also include postage cost?

 

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...