M
Meilu
I don't know if this is possible ... but I have to get a
2nd opinion.
I have 2 tables (simplified to just illustrate my problem)
A
Company, Qty
Tommy 100
B
Date, GroupID, Company, QtyMade
1/1 11 Tommy 10
1/1 12 Tommy 10
1/2 11 Tommy 10
1/2 12 Tommy 10
1/3 11 Tommy 10
1/3 12 Tommy 10
I want a Qry that will return
B.Date, B.Company, A.Qty - Sum*B.QtyMade
So for the above input, I would like the following output:
1/1 Tommy 80
1/2 Tommy 60
1/3 Tommy 40
I tried this:
Select B.Date, B.Company, A.Qty-Sum*B.QtyMade
From B, A
Where B.Company = A.Company and B.Date<=B.Date
Group By B.Company, B.Date
It doesn't work ....
Any idea how to do this?
-Meilu
2nd opinion.
I have 2 tables (simplified to just illustrate my problem)
A
Company, Qty
Tommy 100
B
Date, GroupID, Company, QtyMade
1/1 11 Tommy 10
1/1 12 Tommy 10
1/2 11 Tommy 10
1/2 12 Tommy 10
1/3 11 Tommy 10
1/3 12 Tommy 10
I want a Qry that will return
B.Date, B.Company, A.Qty - Sum*B.QtyMade
So for the above input, I would like the following output:
1/1 Tommy 80
1/2 Tommy 60
1/3 Tommy 40
I tried this:
Select B.Date, B.Company, A.Qty-Sum*B.QtyMade
From B, A
Where B.Company = A.Company and B.Date<=B.Date
Group By B.Company, B.Date
It doesn't work ....
Any idea how to do this?
-Meilu