
Originally Posted by
cwwaicw311
Hi,
I have 3 table:
Staff (Staff ID(PK), Shift)
Inventory (InventoryType(PK),ManchineName)
Transaction (Transaction ID(PK), Date, InvIN, InvOUT, Remarks, Staff ID(FK), InventoryType(FK))
Since i have 10 difference type of inventory, I wanted to create a query whereby for example :Inventory XYZ. So when i open the query it will display:
InventoryType = XYX, InvIN, InvOUT so that i can calculate the balance.
I not sure is it something wrong with my relationship or problem on normalization but the query does not return any value. Pls help, Thank...
Code:
SELECT inv.inventorytype, trans.invin, trans.inout
FROM inventory as [inv], transaction as [trans]
WHERE inv.inventorytype = trans.inventorytype;
This would display your whole inventory. If you need to only find one type of inventory then add another condition to you WHERE clause like
Code:
WHERE inv.inventorytype = trans.inventorytype AND inv.inventorytype=WHAT_YOU_ONLY_WANT_TO_SEE