HI
I have a table with lots of dates, costs and categories, eg;
Date cost cat
01-1-2007 20 1
02-1-2007 30 1
05-1-2007 50 1
08-2-2007 25 1
15-2-2007 80 1
18-2-2007 20 1
Then I do a sum with group by on month and cat:
month cat cost
1 1 100
2 1 125
What I want to do is to get the sum query to return all months with in a given year even though there is no data for some of to months. so for the example above I want the query to return:
month cat cost
1 1 100
2 1 125
3 1 0
4 1 0
5 1 0
6 1 0
7 1 0
8 1 0
9 1 0
10 1 0
11 1 0
12 1 0
How to do that ??
I have a table with lots of dates, costs and categories, eg;
Date cost cat
01-1-2007 20 1
02-1-2007 30 1
05-1-2007 50 1
08-2-2007 25 1
15-2-2007 80 1
18-2-2007 20 1
Then I do a sum with group by on month and cat:
month cat cost
1 1 100
2 1 125
What I want to do is to get the sum query to return all months with in a given year even though there is no data for some of to months. so for the example above I want the query to return:
month cat cost
1 1 100
2 1 125
3 1 0
4 1 0
5 1 0
6 1 0
7 1 0
8 1 0
9 1 0
10 1 0
11 1 0
12 1 0
How to do that ??
Comment