Alternative or workaround to using LIKE in query (1 Viewer)

trstorer

Registered User.
Local time
Today, 08:11
Joined
May 23, 2000
Messages
30
I have a MS Access 2010 database linked to Practicemaster (Tabs3) legal case management system using FairCom c-treeACE ODBC - 32-bit version. I use the Access database for queries and reports. When I upgraded from Version 17 to 18 of PracticeMaster (and the ensuing ODBC driver), the software no longer supports using the LIKE operator on a MEMO field (NOTE field in their world). This has been confirmed by the vendor and I need to find an alternate method of filtering my records. Without knowing much about Access, they are suggesting the CONTAINS or IN operator/function.

I don't see that Access has CONTAINS and the IN operator doesn't fit my needs.

This is the LIKE clause I am using on a MEMO field in a query. I'm looking for a particular string of characters anywhere in the field.
Like "*" & "police" & "*"

What are my options? Is there another alternative to crafting the query to achieve the results I'm looking for?

Any guidance or assistance is very much appreciated.
Thank you.
 

plog

Banishment Pending
Local time
Today, 02:11
Joined
May 11, 2011
Messages
11,645
You could try InStr (https://www.techonthenet.com/access/functions/string/instr.php). It searches a string and tells you the character positionf of where the first instance of a substring starts, if not found it returns 0.

PoliceLocation: InStr([YourFieldHere], "police")

Then in the criteria you put >0


"The police are good guys" -> 5
"I hate cops" -> 0
"Some police are good, some police are bad" -> 6
 

almahmood

Registered User.
Local time
Today, 12:41
Joined
Mar 28, 2017
Messages
47
Are you using ADO? If so, use '%' instead of '*'. Let us know if it works for you. InStr will work as well.
 

trstorer

Registered User.
Local time
Today, 08:11
Joined
May 23, 2000
Messages
30
Thank you, plog, for answering my question - spot on! I had explored InStr but wasn't thinking of adding the criteria part. It works perfectly in a normal database; however, it still is not working using c-treeACE ODBC. Ugh !!! So, now it is back on the vendor with a different error message for Call Failed.

Thank you, almahmood, for your suggestion as well. I had tried the "%" and it didn't work - it really came down to the LIKE operator.
I continue to learn so much - so appreciative of this forum and all the great contributors.
 

Users who are viewing this thread

Top Bottom