mreference
Registered User.
- Local time
- Today, 14:25
- Joined
- Oct 4, 2010
- Messages
- 137
I'm trying to build a query but am having some difficulty, each part works independantly but not together in one query.
I have two tables and an optional table (details at bottom of thread for this)
tblStockItems (Fields: itemID, itemcode, quantity)
tblItemsSold (Fields: itemcode, datesold)
OPTIONAL: tblSource (Fields: itemID, CostPrice, Primary)
I want a query that will list all items from tblStockItems that have not yet been sold with a quantity over 10 as well records from tblItemsSold that have not sold for 30 days with a quantity over 10.
This will give us a list of items that haven't sold yet or have stop selling for for some reason.
OPTIONAL TABLE
If the query above can be created that to start with is perfect, following on from that, if possible I would like to add in the optional table tblSource, so that I could get a value of the stock items in question (multiplying the cost price by quantity).
However, this table may have 1 or more sources supplying the stock item to us, and all with a different price. In this instance I would need the cheapest price to be selected and calculated.
I have tried and got both working seperately but not together and have no idea how to build in the third, it threw up some ridiculous calculations.
I have two tables and an optional table (details at bottom of thread for this)
tblStockItems (Fields: itemID, itemcode, quantity)
tblItemsSold (Fields: itemcode, datesold)
OPTIONAL: tblSource (Fields: itemID, CostPrice, Primary)
I want a query that will list all items from tblStockItems that have not yet been sold with a quantity over 10 as well records from tblItemsSold that have not sold for 30 days with a quantity over 10.
This will give us a list of items that haven't sold yet or have stop selling for for some reason.
OPTIONAL TABLE
If the query above can be created that to start with is perfect, following on from that, if possible I would like to add in the optional table tblSource, so that I could get a value of the stock items in question (multiplying the cost price by quantity).
However, this table may have 1 or more sources supplying the stock item to us, and all with a different price. In this instance I would need the cheapest price to be selected and calculated.
I have tried and got both working seperately but not together and have no idea how to build in the third, it threw up some ridiculous calculations.