Query to find ClosingStock

Sep 21 2011 2:50 AM
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)

Answers (1)