Click here to Skip to main content
15,882,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My table has following
PName Openingqty Closingqty
Maaza    10         10
Cocacola  20         20

I am update Every item sale. if the 2 nos of maaza is sales, then i update the closingqty 8. So today available stock is 8. When i update tomorrow the openingqty is updated for yesterday closingqty. Tomorrow's opening qty is 8.How to change it

Please help me
Posted
Updated 20-Oct-19 21:02pm
v2
Comments
Manoj Kumar Choubey 31-Mar-12 7:14am    
Where you keeping data sales Quantity and Production Quantity, you may Calculate from sales and production table ....

hi there
dear dear dear
just minus your data and just insert new data at that time.

ex.
if you have 10 pepsi on date 30-3-2012 morning.
you sold 2 pepsi on date 30-3-2012.
so finally you will get 8 pepsi on 31-3-2012.
 
Share this answer
 
Comments
Manoj Kumar Choubey 31-Mar-12 7:18am    
I want to say same thing (we can display total opening as on date )
devausha 2-Apr-12 5:42am    
Ok, Thanks for your help
Simply

Opening stock = Total Incoming Stock - Total Outgoing Stock

Total Incoming = Total Purchasing / Total Production etc.
Total Outgoing = Total Sale

Your Closing will be opening stock for next opening / Day.....
 
Share this answer
 
Make the following process daily.

update openingstock with openingstock + purchase - sales.


otherwise

Create a table for transactions like.
date,item,type(sales/purchase/opening),qty. Update each and every transaction.
Using this table you can get opening stock for any date.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900