Hi All,
I have Company column and Domain Column. Here I need a query to match any word from the Company with Domain and mark as True or False. Please find the attachment
Hi All,
I have Company column and Domain Column. Here I need a query to match any word from the Company with Domain and mark as True or False. Please find the attachment
There is no attachment.
I expect you will need to build VBA function.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
seems you forgot the attachment.
You mean any word that you specify?match any word
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
Please find the attachment
Is this really the database involved? What are we to look at? Not enough info.
Example: "2 Sisters Food Group" in this company and " https://www.2sfg.com" web address. I want any of the word from company field like "2" or "Sister" or "Food' or "Group" word should match in web address field. In this case 2 is matching in web address. So it should return True.
Place code in a general module, something like:
Replace() function is handling possibility of apostrophe in company name, such as: Adam's Bakery. If you prefer, can replace with empty string instead of the doubled apostrophe.Code:Function TestMatch(strSource As String) As Boolean Dim aryString As Variant Dim x As Integer aryString = Split(strSource) For x = 0 To UBound(aryString) If Not IsNull(DLookup("Webaddress", "Table1", "Webaddress LIKE '*" & Replace(aryString(x), "'", "''") & "*'")) Then TestMatch = True Next End Function
Then call the function in query:
SELECT Table1.ID, Table1.Company, Table1.Webaddress, TestMatch([Company]) AS M FROM Table1;
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.