aerozeppel
New member
- Local time
- Today, 16:16
- Joined
- Sep 18, 2017
- Messages
- 5
So I have this table to store quantities after each time a stock check is done and am trying to create a query that for each product would do the calculation (previous stock check quantity) - (latest stock check quantity) my tables are laid out as follows:
StockCheckID StockCheckDate ProductID Quantity
1----------------12/08/17---------1-----------3
2----------------12/08/17---------2-----------2
3----------------19/08/17---------1-----------3
4----------------19/08/17---------2-----------3
5----------------26/08/17---------1-----------2
6----------------26/08/17---------2-----------1
The query should produce the result:
ProductID UsedDate UsedAmount
1----------26/08/17------1-----------(=3-2)
2----------26/08/17------2-----------(=3-1)
Would be very grateful for any assistance.
StockCheckID StockCheckDate ProductID Quantity
1----------------12/08/17---------1-----------3
2----------------12/08/17---------2-----------2
3----------------19/08/17---------1-----------3
4----------------19/08/17---------2-----------3
5----------------26/08/17---------1-----------2
6----------------26/08/17---------2-----------1
The query should produce the result:
ProductID UsedDate UsedAmount
1----------26/08/17------1-----------(=3-2)
2----------26/08/17------2-----------(=3-1)
Would be very grateful for any assistance.
Last edited: