Hi there!
I am trying to find out what is wrong with the following code:
- SELECT Investor.Company, Investor.ID, Investor.Country
-
FROM Investor
-
WHERE ((( Investor.Company) In (
-
SELECT [Company]
-
FROM [Investor] As Tmp GROUP BY Left([Company],3)
-
HAVING Count(*)>1
-
And Left([Company],3) =Left([Investor].[Company],3) )));
Its purpose is to find similar entries (that have 3 or more characters common in the begining of their name). egg: if I have ABC234 and ABC345 I want to be given both entries, not only if I have perfect matches, meaning having entered twice ABC234.
The message I keep getting is:
You tried to execute a query that does not include the specified expression "Company" as part of an aggregate function.
Does anyone know what I am doing wrong and what would be the solution?
Thank you!