Hi Guys,
I have constructed the following:
SELECT Components.PartNo, Components.Component, qLastStockTake.Stock, qReceived.Received
FROM (qLastStockTake INNER JOIN Components ON qLastStockTake.PartNo = Components.PartNo) INNER JOIN qReceived ON (qLastStockTake.Component = qReceived.Component) AND (qLastStockTake.PartNo = qReceived.PartNo)
GROUP BY Components.PartNo, Components.Component, qLastStockTake.Stock, qReceived.Received;
Now I want to add in another field that will SUM the Received and Stock fields together. However I keep getting a field which just joins Received and Stock.
For example for Part 1 i have 1000 in stock, 1000 Received. I want total to give me 2000. However at present when I sum the fields i get 10001000?
What silly mistake am I making?!
I have constructed the following:
SELECT Components.PartNo, Components.Component, qLastStockTake.Stock, qReceived.Received
FROM (qLastStockTake INNER JOIN Components ON qLastStockTake.PartNo = Components.PartNo) INNER JOIN qReceived ON (qLastStockTake.Component = qReceived.Component) AND (qLastStockTake.PartNo = qReceived.PartNo)
GROUP BY Components.PartNo, Components.Component, qLastStockTake.Stock, qReceived.Received;
Now I want to add in another field that will SUM the Received and Stock fields together. However I keep getting a field which just joins Received and Stock.
For example for Part 1 i have 1000 in stock, 1000 Received. I want total to give me 2000. However at present when I sum the fields i get 10001000?
What silly mistake am I making?!