Brian Dunning's FileMaker Custom Functions

SetQueryConditionLike ( _datafield ; _condition ; _orchar ; _andchar ; _leadingWC )

Generate SQL WHERE-conditions for a string of (multiple) value(s)

  Be the first to rate this function Log in to vote

Otmar Kramis   Otmar Kramis - Show more from this author
https://developer.balimusic.ch

Share on Facebook Share on Twitter

  Sample input:
SetQueryConditionLike ( "FullName" ; "John,James&Jeffry" ; "" ; "" ; 1 )
  Sample output:
(UPPER(FullName) LIKE '%JOHN%' OR UPPER(FullName) LIKE '%JAMES%' AND UPPER(FullName) LIKE '%JEFFRY%')

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Builds a WHERE-condition LIKE string for a SQL field and a search string containing search values delimited by OR-character or/and AND-character. Parameter 3-5 can be empty, defaulting to "," for OR, "&" for AND and no leading wildcard (%). The asterix "*" is handled as SQL wildcard.

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 15 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth:

Under construction. Email me your wish list for improvements.