SELECT basepoundsperhour, txtproductname, tplantproducts.ProductID, isnull(poundsperhour,0) as poundsperhour, tHourlyTransactions.HourlyTransactionsID from tproduct inner join tplantproducts ON tproduct.productid = tplantproducts.productid left outer join tHourlyTransactions on tproduct.productid = tHourlyTransactions.productid left outer join tShiftDetails on tShiftDetails.ShiftIDetailD = tHourlyTransactions.ShiftID
i need it to always return
basepoundsperhour,
txtproductname,
tplantproducts.ProductID
and then see if those items exist in the tHourlyTransactions table if not just return 0 for isnull(poundsperhour,0) as poundsperhour
so for example: as must always return
sand 1000 1 salt 50000 2
example of what it should return
sand 1000 1 500 34 salt 50000 2 0