Help with contains in a formula

I have the following code in a calendar view:

SELECT ((Form = "Time Off Request") | (Form = "TimeOff")) & (@Contains(Add_Calender; "Yes")) & (@Contains(Type; "Associate")) & (!@Contains(Status; "Pending")) & (!@Contains(Team; "LCCC")) &  (!@Contains(Team; "Team Services")) & (!@Contains(Team; "Mail/Image")) &(!@Contains(Team; "LRU"))  & (!@Contains(Team;"Team Services/Filing")) & RequestType !="Overtime"

This does work but I am wondering if there is a better way to write the Does Not Contain portion. I have tried this:

!@Contains(Team;"LCCC"|"Team Services"|Mail/Image"|"LRU") and that does not work. It will not pull any records then at all.  Does anyone have any suggestions or am I just missing the boat on how @Contains works.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I think you are confusing @Contains and @IsMember.

@Contains is used to search a string for a sub-string.
@IsMember (and @IsNotMember) are used to indicate whether a list (or multiple-value field) includes a specific value.

Further, if the field can only accept one value, and you are matching the full value (not a sub-string), then you can simply use the 'equals' operator (=).

For example, it appears to me that Add_Calender is a single-value field that either contains "Yes" or "No".  If this assumption is correct, then I would not use @Contains, I would just use (Add_Calender = "Yes").

Below is an example of how I would write this selection formula based on these assumptions:

Single-valued fields:

Multiple-valued fields:

(If these assumptions are not correct, then the formula below will need to be modified).
SELECT @IsMember(Form; "Time Off Request" : "TimeOff") & 
(Add_Calender = "Yes") & (Type = "Associate") & (Status != "Pending") & 
@IsNotMember(Team; "LCCC" : "Team Services" : "Mail/Image" : "LRU" : "Team Services/Filing") & 
(RequestType != "Overtime")

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kali958Author Commented:
Thank you Bill. That is what I needed. I was missing the difference between the @Contains and @IsMember. I thought also that @IsNotMember and @IsMember was only to be used with UserRoles.  I appreciate the education and the prompt answer!  Thanks again
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.