megatronixs
Registered User.
- Local time
- Today, 17:38
- Joined
- Aug 17, 2012
- Messages
- 719
Hi all,
I needed to create a query that will check in 2 different tables for the first name and surname if there is a match. The trouble is that there could be a typo and a first name or surname would be missing or having to much letters. for example McCanna vs McCana or with the first name John vs Joh.
I can imagine that if I would compare John McCanna in a table where Joh McCanna or John McCanna, I would have troubles getting results.
The below query, does not get me the data, only if they really match.
any way to make it get fixed?
Greetings.
I needed to create a query that will check in 2 different tables for the first name and surname if there is a match. The trouble is that there could be a typo and a first name or surname would be missing or having to much letters. for example McCanna vs McCana or with the first name John vs Joh.
I can imagine that if I would compare John McCanna in a table where Joh McCanna or John McCanna, I would have troubles getting results.
The below query, does not get me the data, only if they really match.
any way to make it get fixed?
Code:
SELECT DISTINCT [Fund Data].TITLE, [Fund Data].FORENAME, [Fund Data].SURNAME, [Fund Data].PRIMARY_DOB, tbl_exit_notification.Title, tbl_exit_notification.[First Name], tbl_exit_notification.[Surname_Business Name], tbl_exit_notification.[Date of Birth], tbl_exit_notification.[Client ID]
FROM [Fund Data] INNER JOIN tbl_exit_notification ON ([Fund Data].SURNAME = tbl_exit_notification.[Surname_Business Name]) AND ([Fund Data].PRIMARY_DOB = tbl_exit_notification.[Date of Birth])
WHERE ((([Fund Data].SURNAME) Like "*" & [tbl_exit_notification].[Surname_Business Name] & "*") OR ((tbl_exit_notification.[Surname_Business Name]) Like "*" & [Fund Data].[SURNAME] & "*"));
Greetings.