Here's the query...
Each MembID as multiple vendors. Each vendor has a count associated with is. [Counter] is a unique id on the table. I want the MembID and the Vendor with the highest count. One row per member. It is not working. The table has 1470 rows and the query returns all rows.
Help!
Greg
Code:
SELECT tblSJHSVendorCount.MembID,
tblSJHSVendorCount.Vendor,
(SELECT TOP 1 VendCount2.CountOfVendor
FROM tblSJHSVendorCount AS VendCount2
WHERE tblSJHSVendorCount.MembID = VendCount2.MembID
ORDER BY VendCount2.CountOfVendor DESC, Counter) AS MaxVendCount
FROM tblSJHSVendorCount;
Help!
Greg