Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I've read some posts about search strings but couldn't find the NOT operator.
I would like to write a searchstring when I try to select some values in a listbox:
(*XXX* & "NOT" *Archive*)
My goal is to select all values from the field "FolderPath" that contain the string "XXX" but NOT the string "Archive".
What is the correct syntax for this?
,Thanks in advance, Koen
Message was edited by: Koen Bal
=Field like '*XXX*' and not Field like '*Archive*'
This should work:
if(substringcount([FolderPath],'XXX')<>0,if(substringcount([FolderPath],'Archive')=0,[FolderPath]))
This is a standard "IF" statement. The first part counts the occurrences of the string 'XXX'. If count is not 0, then the next part of the IF statement is executed, which counts the occurrences of the string 'Archive'. If count is 0, then the next part of the IF statement is executed which is the output of the field FolderPath.
swuehl wrote:
Try
("*XXX*" ^"*Archive*")
^ is the binary XOR operator, not the unary NOT / complement operator, which I still don't know if it does exist for the compound search.
So this is not exactely what Koen asked for (it will for example return paths with Archive contained, but not XXX).
But I believe this should return the correct results:
(*XXX* & (*XXX* ^ *Archive*))
edit:
I used the time on this rainy day to write up some stuff about the compound search:
Works as expected.