I have two querries and I would like to return the Top 5 inner joins that it finds. i.e I have an item in one query and it is found many times in another. I would like it to report the top 5 CustNames with the 5 biggest quantities. I try this:
SELECT qryPollyEnduranceItems.ITEM, qryInvoices.ICustName, qryInvoices.IShipQty
FROM qryPollyEnduranceItems
INNER JOIN qryInvoices ON qryPollyEnduranceItems.ITEM = qryInvoices.IItemNo
WHERE qryInvoices.ICustName = (SELECT TOP 5 ICustName FROM qryInvoices)
ORDER BY qryPollyEnduranceItems.ITEM, qryInvoices.IShipQty DESC;
but I get "At most one record can be returned by this subquery" Error.
Any idea? Thanks in advance for your help
The greatest risk, is not taking one.