cmdselect.CommandText = "select PD.Prod_ID,PD.Prod_BrandName, PD.Prod_ModelNo,sum(case when PM.prod_Qty is not null then PM.prod_Qty else 0 end ) as Purchase_Item,sum(case when SM.prod_Qty is not null then SM.prod_Qty else 0 end) as Sale_Item,sum(case when PM.prod_Qty is not null then PM.prod_Qty else 0 end )- sum(case when SM.prod_Qty is not null then SM.prod_Qty else 0 end) as Balance_Item from tbl_ProductDetails PD left join tbl_PurchaseMaster PM on PD.Prod_ID=PM.Prod_ID left join tbl_SaleMaster SM on PD.Prod_ID=SM.Prod_ID group by PD.Prod_ID,PD.Prod_ModelNo,PD.Prod_BrandName";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)