I need a query that will return the date of every Monday between two dates. It is intended to be in the basis of another query that counts weekly transactions (Monday till Sunday), and it should be able to represent weeks without any transaction.
This means it can't rely on the existing data in the transactions table, because there is no representation there to weeks without any transactions.
For example: for the 3 weeks starting on Monday - July 21, 2014 - I need a query that returns the following:
2014-07-21
2014-07-28
2014-08-04
Assuming my transactions were logged on the following dates:
2014-07-22
2014-07-23
2014-07-25
2014-08-05
I will want to write a query that returns the aggregated number of transaction per week:
2014-07-21 => 3
2014-07-28 => 0
2014-08-04 => 1
And that's why I can't rely on the data itself, and need a query to generate every Monday between two given dates. Any suggestions?