I need your help to find out the query for 'As of Date' stock from inventory table. Out inventory history table has the following structure
It is the history table, every stock movement would be updated here or append as a record. By using this, find out the sum of Pkg qty for the specified date in a customer.
For expample, 28th March a customer, who named as GSI, received 100 items, 30th March 25 items are allocated . 2nd April he received 50 items and 5th March 80 items has allocated to him. Now the total stock avail has been 45. In Stock Inquiry page, if enter 31st Mar in 'As of Date' field, Avail Qty should show 75
Anybody help me to write a query for this. I tried to write it, but failed.
Please help me as soon as possible