you use a group by query and sum the transactions by joining the table to itself
transactions should all be in one table (receipts/sales/opening stock/stock adjustments, etc) so your table should look something like
tblTransactions
ProdName….TranFK…...TranDate……….Qty
Product A....receipt1....01/11/2018....-600
Product A....order1.....16/11/2018.....200
Product A....order2.....20/11/2018.....300
Product A....order3.....26/11/2018.....175
then your query would join the table to itself, using aliases - something like
Code:
SELECT A.ProdName, A.TranFK, A.TranDate, Sum(B.Qty) as Balance
FROM tblTransactions A INNER JOIN tblTransactions B ON A.ProdName=B.ProdName
WHERE B.TranDate<=A.TranDate
GROUP BY A.ProdName, A.TranFK, A.TranDate
edit: if this is for a report, you can use the running sum feature in reports instead - but your table would still be the same as above.
Note also, if you have two orders on the same date, then unless your date includes a time the query will put the same value in both rows - or you need some basis for determining order