nicole.skeeters
Registered User.
- Local time
- Today, 14:14
- Joined
- Aug 16, 2013
- Messages
- 18
Please see this thread in regards to the tables etc I've got so far: (I cant link yet) Theory and Practice - "Database Dummy - design help?"
According to plog's suggestion, I've written a query on my tbl_transactions to calculate the current stock field. I'm not sure that I've done my expression correctly: "Current Stock: [transactiontypes].[transaction type value]*[transactions].[quantity]."
This gives me a negative value, which obviously is not correct. Is it possible that this needs to be written another way? As in, if the transaction type is 3 (which is -1 for allocation), then [transaction type value]+[quantity]. I'm just not sure if I can write this all in the same expression or if it needs to build off the expression inside another expression.
My next question is about calculating the transaction's cost. Plog had suggested that the item costs be held in another table due to the possibility of them changing, and I assumed from there that transaction cost too should be a calculated field and not a stored field. Therefore, I have a query set up as:
SELECT Transactions.[Transaction ID], Transactions.[Item ID], ItemCost.[Item Cost]
FROM Transactions LEFT JOIN ItemCost ON Transactions.[Item Cost ID] = ItemCost.ID
WHERE (((Transactions.[Transaction ID])=3));
This pulls the one transaction I have in there (trans value =3) but it will not pull the cost. :banghead:
So, I know this is two different query issues, and I can separate them into different posts if need be, but I appreciate any help anyone feels like throwing out there!
Thx
Nicole
According to plog's suggestion, I've written a query on my tbl_transactions to calculate the current stock field. I'm not sure that I've done my expression correctly: "Current Stock: [transactiontypes].[transaction type value]*[transactions].[quantity]."
This gives me a negative value, which obviously is not correct. Is it possible that this needs to be written another way? As in, if the transaction type is 3 (which is -1 for allocation), then [transaction type value]+[quantity]. I'm just not sure if I can write this all in the same expression or if it needs to build off the expression inside another expression.
My next question is about calculating the transaction's cost. Plog had suggested that the item costs be held in another table due to the possibility of them changing, and I assumed from there that transaction cost too should be a calculated field and not a stored field. Therefore, I have a query set up as:
SELECT Transactions.[Transaction ID], Transactions.[Item ID], ItemCost.[Item Cost]
FROM Transactions LEFT JOIN ItemCost ON Transactions.[Item Cost ID] = ItemCost.ID
WHERE (((Transactions.[Transaction ID])=3));
This pulls the one transaction I have in there (trans value =3) but it will not pull the cost. :banghead:
So, I know this is two different query issues, and I can separate them into different posts if need be, but I appreciate any help anyone feels like throwing out there!
Thx
Nicole