G
gert birkner
I have to combine the data of 2 tables to show them in a list field with 3
columns:
stock table:
CustomerNo.
StockQuantity
if the StockQuantity= 0 there is now row for this customer in this table
order table
CustomerNo
OrderQuantity
CustomerNo is in both tables the primarykey.
I want to show for each CustomerNo the SUM(StockQuantity) and
SUM(OrderQuantity).
The problem is, that neither of these tables contains all of the existing
CustomerNo.
So there are rows in "stock" which don´t exist in "order" and rows in
"order" which don't exist in "stock".
My resultset should look like: (3 columns: CustomerNo; StockQuantity;
OrderQuantity)
100 3 0
101 0 4
102 2 4
....
I can´t formulate a query which show a result like that
thank you in advance
gert birkner
columns:
stock table:
CustomerNo.
StockQuantity
if the StockQuantity= 0 there is now row for this customer in this table
order table
CustomerNo
OrderQuantity
CustomerNo is in both tables the primarykey.
I want to show for each CustomerNo the SUM(StockQuantity) and
SUM(OrderQuantity).
The problem is, that neither of these tables contains all of the existing
CustomerNo.
So there are rows in "stock" which don´t exist in "order" and rows in
"order" which don't exist in "stock".
My resultset should look like: (3 columns: CustomerNo; StockQuantity;
OrderQuantity)
100 3 0
101 0 4
102 2 4
....
I can´t formulate a query which show a result like that
thank you in advance
gert birkner