bs0d
Well-known Member
- Joined
- Dec 29, 2006
- Messages
- 622
I'm not much of a query guy and I'd like some help on determining the best approach to achieve what I'm after.
Suppose I have a table of products, and a table of sales by date. Older products have longer sales histories, new products have shorter sales histories.
I would like to show the total product sales where day 1 is the same for all items, and so on. I think this is called a time zero or normalized view.
So assume we had this data:
Then my desired output would look like this:
Suppose I have a table of products, and a table of sales by date. Older products have longer sales histories, new products have shorter sales histories.
I would like to show the total product sales where day 1 is the same for all items, and so on. I think this is called a time zero or normalized view.
So assume we had this data:
Code:
id date item sales
1 1/1 441 10
2 1/2 441 15
3 5/6 789 05
4 5/7 789 08
5 5/8 789 13
6 3/4 529 03
7 3/5 529 14
8 3/6 529 25
9 3/7 529 35
Code:
Day SUMofSales CountofItem
1 18 3
2 37 3
3 38 2
4 35 1