I am working in the MS Access query builder. I'm using a user-defined function to return a bracketed group of characters to search for. For example, the criteria line is
Like Tcode()
and the function Tcode() is
Function Tcode() As String
Tcode = "[AC]"
End Function
If I create a local table of data with 3 single-character rows of data
A
B
C
and run a query on that column with this criteria, I get just the rows of A and C, as desired. If I run it with the criteria of
Like "[AC]"
I also get just the rows of A and C, as desired. The problem comes in when I run a query against an ODBC Oracle table we have. If I use the criteria of Like "[AC]" then I get results of A and C. If I use the criteria of like Tcode() then I get no results. I have tried several variations on the return value of Tcode without success:
Tcode returns [AC] No results
Tcode returns "[AC]" No results
Tcode returns [[AC]] No results
Tcode returns [A] No results
Tcode returns A Results in all rows with A
I want to dynamically build the Tcode return value to get different results based on user inputs on other forms. Why doesn't it work on the odbc table? I'd also accept a method that builds a search like
in ('A','C')
or
'A' or 'C'
but I don't know how to implement that using functions.
Edit: Oracle version
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
PL/SQL Release 12.1.0.2.0 - Production
"CORE 12.1.0.2.0 Production"
TNS for IBM/AIX RISC System/6000: Version 12.1.0.2.0 - Production
NLSRTL Version 12.1.0.2.0 - Production
Client drivers 19.5