I have created a table name Sale having Six columns
**SlNo Product Type Date Quantity Stock_balance`**
1 A IN 1/2/16 40 40
2 A OUT 2/2/16 20 20
3 A OUT 2/2/16 10 10
4 B IN 1/2/16 30 30
5 B OUT 2/2/16 20 10
6 A OUT 5/2/16 05 05
These type of data entered upto Quantity but Stock_balance need to updated with update sql queries. Product A and B each summing for ‘IN’ or subtraction for ‘Out’ related to Previous date entries for particular product. I want to overcome missed entries which later insert with correct date then all data related to product Stock_balance corrected. I am not getting idea to update stock_balance with use of date… or other references to performs this task
thanks in advance for help