Hi there. I have a SQL statement below that is not calculating correctly. Let's say I ship 10 apples. The following sql statement for my Inventory report shows correctly. But when I enter that I receive 5 apples. The sql inventory report shows 10. It seem to be matching or even mutiplying quantities. Any suggestions as how I can corect this???
select main.equipmentid, sum(receive.quantity) as 'receivedsum', sum(shiplist.quantity) as 'shippedsum' , sum(loan.quantity) as 'loanedsum'
from main
left join receive on main.equipmentid = receive.equipmentid
left join shiplist on main.equipmentid = shiplist.equipmentid
left join loan on main.equipmentid = loan.equipmentid
group by main.equipmentid order by main.equipment asc