If not too much a bother, would you please cut and paste the following SQL statement into your phpAdmin query tool for your database, hit the GO button, and then send me a picture of your query results. I'm at [email protected].
SELECT date(a.date_purchased) orderdate, count(a.orders_id) ordercount, max(b.value) ordermax, sum(round(b.value, 2)) subtotal, IFNULL(sum(round(c.value, 2)),0) coupons, IFNULL(sum(round(d.value, 2)),0) discounts, sum(round(a.order_tax, 2)) tax, IFNULL(sum(round(e.value, 2)),0) shipping, sum(a.order_total) ordertotal FROM orders a JOIN orders_total b ON a.orders_id=b.orders_id AND b.class='ot_subtotal' LEFT JOIN orders_total c ON a.orders_id=c.orders_id AND c.class='ot_coupon' LEFT JOIN orders_total d ON a.orders_id=d.orders_id AND d.class='ot_gv' LEFT JOIN orders_total e ON a.orders_id=e.orders_id AND e.class='ot_shipping' WHERE date_purchased >= '2009-01-01' AND date_purchased < DATE_ADD('2009-07-31', INTERVAL 1 DAY) GROUP BY orderdate
Thanks.



what did you have in mind?
I can also usually search through to find what I'm looking for if I know approximately what table something should be in.
Reply With Quote
