GK in the UK
Registered User.
- Local time
- Today, 20:31
- Joined
- Dec 20, 2017
- Messages
- 274
Query and Sub Query Help Please
Trying to get an updateable query working which draws totals from a sub query.
I can't get the totals from qrysub_QtyDelivered into the main query
Here's a screenshot of the sub query result set and the main query result with the missing result
Trying to get an updateable query working which draws totals from a sub query.
I can't get the totals from qrysub_QtyDelivered into the main query
Here's a screenshot of the sub query result set and the main query result with the missing result
Code:
SELECT tblTransHeaders.TransHeaderID, tblTransLines.TransLineID, tblTransLines.tlCtrlPosting, tblTransLines.tlVatPosting, tblTransLines.tlProductFK, qrysub_QtyDelivered.qDelivered, tblSelectLines.slOrdPicked, tblSelectLines.slOrdCancelled
FROM tblTransHeaders
INNER JOIN (qrysub_QtyDelivered
RIGHT JOIN (tblTransLines
LEFT JOIN tblSelectLines
ON tblTransLines.TransLineID = tblSelectLines.SelectLinesID)
ON (qrysub_QtyDelivered.TransHeaderID = tblTransLines.tlOrderHeaderFK) AND (qrysub_QtyDelivered.tlProductFK = tblTransLines.tlProductFK))
ON tblTransHeaders.TransHeaderID = tblTransLines.tlTransHeaderFK
WHERE (((tblTransHeaders.TransHeaderID)=[HeaderID]) AND ((tblTransLines.tlCtrlPosting)=False) AND ((tblTransLines.tlVatPosting)=False));