wow, thanks  .
I was monkeying around with this for many hours now. I modified your code to right join so that it displays null values also.
If I may.... ask one more thing: There is another column in Table1 called TotalValue. Again the total needs to be summed up from table2 where Table1.ID = Table2.InventoryID
Totalvalue on row 1 should be 60 and 40 on row 2. I appriciate your help.
Table 1: Inventory
ID-----Company Name-----------CreditTotal------------TotalValue
1 -------- Company A ------------------ 2000----------------------
2 -------- Company B ------------------ 600------------------------
Table 2: Credit
ID --- InventoryID ---------- Credit-------Value
1 ----------- 1 ------------------ 1200------------20
2 ----------- 1 -------------------600-------------20
3 ----------- 1 -------------------200-------------20
4 ----------- 2 -------------------500-------------20
5 ----------- 2 -------------------100-------------20
|