@CategoryID int=null --@DateFrom datetime=null, --@DateTo datetime=null AS BEGIN if @CategoryID is not null Begin SELECT (SELECT dbo.udf_GetQty(invID)) Qty, (SELECT dbo.udf_GetAverageCost(invID)) AvgCost, (SELECT dbo.udf_GetTotalStockValue(invID)) TotalStockValue, tblStockDetails.*,tblStockHeader.*,tblUnitMaster.*,tblInventoryMaster.* FROM tblStockDetails INNER JOIN tblStockHeader ON tblStockDetails.sdDID = tblStockHeader.shDID AND tblStockDetails.sdDocType = tblStockHeader.shDocType left outer join tblUnitMaster on tblStockDetails.sdUnitID=tblUnitMaster.unID left outer join tblInventoryMaster on tblStockDetails.sdInventoryID=tblInventoryMaster.invID WHERE tblStockHeader.shIsDelete=0 ORDER BY tblStockHeader.shDocumentDateTime
select isnull(fldnm,0) --this will give 0 if value is null
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)