Query to find ClosingStock
Hi...
I want to generate closing stock report. In that previous date of closingstock will become next day opening stock. how to do so.
My table contain Date,Openingstock,Production,Dispatch
ClosingStock =openinstock+production-Dispatch. I m geting Closing Stock in my query. But how to Get OpeningStock.
Query:
select date,openingstock,production,dispatch,(openingstock+production-dispatch) as ClosingStock
from ListDates(@StartDate,@EndDate)