As an example, if I've got a query like this:
Code: Select all
SELECT
DATE_FORMAT(`time_ordered`, '%d/%m/%y') AS `date`,
SUM(`total_price`) AS `total_takings`
FROM
`orders`
WHERE
`completed` = 'Y'
AND
`time_ordered`
BETWEEN
'2008-07-07'
AND
'2008-08-01'
GROUP BY
YEAR(`time_ordered`) AND DAYOFYEAR(`time_ordered`)Code: Select all
Array ( [0] => Array ( [date] => 08/07/08 [total_takings] => 129.00 ) )Code: Select all
Array (
[0] => Array ( [date] => 07/07/08 [total_takings] => 0.00 ),
[1] => Array ( [date] => 08/07/08 [total_takings] => 129.00 ),
[2] => Array ( [date] => 09/07/08 [total_takings] => 0.00 ),
[3] => Array ( [date] => 10/07/08 [total_takings] => 0.00 ),
[4] => Array ( [date] => 11/07/08 [total_takings] => 0.00 ),
... etc, etc through to the max BETWEEN clause...
)Even if that isn't possible, is it possible to run a query in MySQL to just fetch every date between 2 dates?
Thanks.