select
tblproduct.itemname As Item_Name,
((sum(tblpurchase.[case]) * tblproduct.pc)-
((sum(tblsale.[case]) * tblproduct.pc)+(sum(tblsale.nos))))
As Remaining_Stock
From
(tblproduct
left Join
tblpurchase on tblproduct.itemname=tblpurchase.itemname)
left join
tblsale on tblproduct.itemname = tblsale.itemname
where
tblproduct.itemname='Combo Soap'
group by
tblproduct.itemname
Error is shown in the screenshot. I am unable to run this query. Please help me to find solution how to solve and run this query! Thank you.


Try this:
Output: