0

I want to convert this mysql syntax into a doctrine 1.2 syntax. I want to show dates with zero values and print some errors on it. Also, is PHP foreach loop relevant for this for the templates/views?

SELECT calendar.datefield AS DATE,
       IFNULL(SUM(orders.quantity),0) AS total_sales
FROM orders RIGHT JOIN calendar ON (DATE(orders.order_date) = calendar.datefield)
WHERE (calendar.datefield BETWEEN (SELECT MIN(DATE(order_date)) FROM orders) AND (SELECT MAX(DATE(order_date)) FROM orders))
GROUP BY DATE..

data table display example

Wilq
  • 2,245
  • 4
  • 33
  • 37
  • 3
    Looks like you are looking for someone tthat will do your work? What have you tried? – MSadura Jun 17 '14 at 07:32
  • @MarkS I totally pictured [Clippit](http://en.wikipedia.org/wiki/Office_Assistant) writing that comment ;) – Phil Sep 03 '14 at 07:27

0 Answers0