displaying SUM
Hey Ray
Am trying to display a couple of SUM of order value on the order_results page
I have got the last x days with
<?php
$OrdersValue = new WA_MySQLi_RS("OrdersValue",$DBConnection);
$OrdersValue->setQuery("SELECT SUM(OrderAmount) AS OrderValue FROM orders WHERE OrderDate > DATE_ADD(CURDATE(), INTERVAL -180 DAY);");
$OrdersValue->execute();
?>
Am trying to also show this month as well as show last months values - obvioulsy this is in the orders table and the OrderValue column. The date columns is the OrderDate which is a TIMESTAMP
Am displaying like this
This Month: £xxx.00 Last Month: £xxx.00 Last 6 Months: £xxx.70
Thanks
Jamie