J
Jenny
Hi everybody, on a table containing a Date and a Product field, I execute
the following simple query:
SELECT MyTable.Date, Count(MyTable.Product) AS ProductCount
FROM MyTable
GROUP BY MyTable.Date
ORDER BY MyTable.Date;
The result looks like this:
Date ProductCount
2004-03-23 89
2004-03-24 205
2004-03-27 24
2004-03-28 167
2004-04-01 122
However, I'd prefer the entire date span from the lowest date
Min(MyTable.Date) up to the highest date Max(MyTable.Date) to be shown, i.e.
including dates with a zero product count, so the query result would look
like this:
Date ProductCount
2004-03-23 89
2004-03-24 205
2004-03-25 0
2004-03-26 0
2004-03-27 24
2004-03-28 167
2004-03-29 0
2004-03-30 0
2004-03-31 0
2004-04-01 122
Any advice?
the following simple query:
SELECT MyTable.Date, Count(MyTable.Product) AS ProductCount
FROM MyTable
GROUP BY MyTable.Date
ORDER BY MyTable.Date;
The result looks like this:
Date ProductCount
2004-03-23 89
2004-03-24 205
2004-03-27 24
2004-03-28 167
2004-04-01 122
However, I'd prefer the entire date span from the lowest date
Min(MyTable.Date) up to the highest date Max(MyTable.Date) to be shown, i.e.
including dates with a zero product count, so the query result would look
like this:
Date ProductCount
2004-03-23 89
2004-03-24 205
2004-03-25 0
2004-03-26 0
2004-03-27 24
2004-03-28 167
2004-03-29 0
2004-03-30 0
2004-03-31 0
2004-04-01 122
Any advice?