I am trying to filter my Excel table records based on a field which is composed of list separated by a comma. I tried to use a public UDF on my Excel module that returns a boolean to add a condition to my SQL query but I found out that it is not possible. I've got runtime error Undefined function 'MyFunction' in expression.
The logic of the function is to check if the Param1 list are ALL available in the list in the Lookup field. If ALL are available then it returns TRUE, otherwise returns FALSE. Below is the example
Is this possible to do only in a query without using a UDF? Thank you for your help.
SQL:
SELECT * FROM Table WHERE MyFunction(Param1,FieldName) = TRUE
The logic of the function is to check if the Param1 list are ALL available in the list in the Lookup field. If ALL are available then it returns TRUE, otherwise returns FALSE. Below is the example
VBA Code:
MyFunction("aa,ab,cc","aa,ab,ac,ad,ae")
'returns: false
MyFunction("aa,ab,cc","aa,ab,ac,ad,cc")
'returns: True
Is this possible to do only in a query without using a UDF? Thank you for your help.