I have a quick syntax question. In the SQL below, how would I include a wildcard with the [FirstName] so that if the FirstName has a middle initial after it, it will still be included in the query result.
For example:
( Anthony Susan = Anthony Susan B )
I know that * is the wildcard, just don’t know how to include it in the statement.
SELECT All_Personnel.LastName, All_Personnel.FirstName, All_Personnel.Active, All_Personnel.EEID, All_Personnel.JobTitle, All_Personnel.Department, All_Personnel.RollUp, All_Personnel.Supervisor, All_Personnel.SupervisorEEID, All_Personnel.StartDate, All_Personnel.TermDate, All_Personnel.PersonnelType
FROM All_Personnel
WHERE (((All_Personnel.LastName) In (SELECT [LastName] FROM [All_Personnel] As Tmp GROUP BY [LastName],[FirstName] HAVING Count(*)>1 And [FirstName] = [All_Personnel].[FirstName])))
ORDER BY All_Personnel.LastName, All_Personnel.FirstName;
For example:
( Anthony Susan = Anthony Susan B )
I know that * is the wildcard, just don’t know how to include it in the statement.
SELECT All_Personnel.LastName, All_Personnel.FirstName, All_Personnel.Active, All_Personnel.EEID, All_Personnel.JobTitle, All_Personnel.Department, All_Personnel.RollUp, All_Personnel.Supervisor, All_Personnel.SupervisorEEID, All_Personnel.StartDate, All_Personnel.TermDate, All_Personnel.PersonnelType
FROM All_Personnel
WHERE (((All_Personnel.LastName) In (SELECT [LastName] FROM [All_Personnel] As Tmp GROUP BY [LastName],[FirstName] HAVING Count(*)>1 And [FirstName] = [All_Personnel].[FirstName])))
ORDER BY All_Personnel.LastName, All_Personnel.FirstName;