ALTER PROCEDURE [dbo].[rptrm_pm_stck_summary] @frmdate date, @todate date AS BEGIN select item_code,(select item_desc from tblItemMaster where cs.item_code=item_code)as item_desc,(select UOM from tblItemMaster where cs.item_code=item_code)as UOM,batch_no, opening_qty ,(select SUM(receipt_qty) from tblGRNEntry where GRN_Date between @frmdate and @todate and cs.item_code=item_code and cs.batch_no=batch_no) as receipt_qty,(select SUM(issue_qty) from tblMINDateEntry where MIN_Date between @frmdate and @todate and cs.item_code=item_code and cs.batch_no=batch_no) as issue_qty, (select SUM(Qty) from tblStockAdjustment where Ref_Date between @frmdate and @todate and cs.item_code=item_code and cs.batch_no=batch_no) as ads_qty --,(opening_qty+(select SUM(receipt_qty) from tblGRNEntry where GRN_Date between @frmdate and @todate and cs.item_code=item_code and cs.batch_no=batch_no)-(select SUM(issue_qty) from tblMINDateEntry where MIN_Date between @frmdate and @todate and cs.item_code=item_code and cs.batch_no=batch_no)+(select SUM(Qty) from tblStockAdjustment where Ref_Date between @frmdate and @todate and cs.item_code=item_code and cs.batch_no=batch_no)) from tblClosingStock cs where adddate between @frmdate and @todate --select * from tblClosingStock cs -- [rptrm_pm_stck_summary] '2011-1-1','2012-12-1' END
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)