Solved

Mutiple Conditions

Posted on 2002-03-12
5
155 Views
Last Modified: 2013-12-18
I have these conditions in a view selection separated with an OR (|) however the view is only using one of the conditions. Is there another way of doing this?  Here is my code:

SELECT (@Contains(qcspecs; "Yes")) & (@Contains(koshstat; "Yes")) & (@Contains(microspecs; "Yes")) & (@Contains(takenoff; "No")) & (@Contains(scaleyesno; "No")) | (@Contains(qcspecs; "Yes")) & (@Contains(koshstat; "Yes")) & (@Contains(microspecs; "Yes")) & (@Contains(takenoff; "No")) & (@Contains(scaleyesno; "Yes")) & (@Contains(scalecomplete; "Yes"))

Willing to up the points for a good answer.
0
Comment
Question by:schmad01
5 Comments
 

Accepted Solution

by:
David_Gordon earned 65 total points
ID: 6858216
Try this:

SELECT @Contains(qcspecs; "Yes") & @Contains(koshstat; "Yes") & @Contains(microspecs; "Yes") & 
@Contains(takenoff; "No") & (@Contains(scaleyesno; "No") | & (@Contains(scaleyesno; "Yes")
& @Contains(scalecomplete; "Yes")))



Use parentheses to group conditions as per the intended logic in this part of the code: (@Contains(scaleyesno; "No") | & (@Contains(scaleyesno; "Yes")
& @Contains(scalecomplete; "Yes"))); This translates to "if scaleyesno is No OR (if scaleyesno is Yes AND scalecomplete is yes)"

Try to avoid using extra parentheses if possible. Although they are technically correct, they are an obstacle to comprehension.

0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6858218
SELECT @Contains(qcspecs; "Yes") & 
@Contains(koshstat; "Yes") & 
@Contains(microspecs; "Yes") & 
@Contains(takenoff; "No") & 
(@Contains(scaleyesno; "No") | @Contains(qcspecs; "Yes")) & 
@Contains(koshstat; "Yes") & @Contains(microspecs; "Yes")&
@Contains(takenoff; "No") & @Contains(scaleyesno; "Yes")&
@Contains(scalecomplete; "Yes")

Probably you should group the or clause.

If you could put the logic in plain words then I can see where it goes wrong.

PS: I have removed the extra brackets which is not necessary.

~Hemanth
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6858238
My proposal is:
SELECT (@Contains(qcspecs; "Yes")&@Contains(koshstat; "Yes")&@Contains(microspecs; "Yes")&@Contains(takenoff; "No"))&(@Contains(scaleyesno;"No")|(@Contains(scaleyesno; "Yes")
&@Contains(scalecomplete;"Yes")))

<|;-)

0
 
LVL 10

Expert Comment

by:zvonko
ID: 6858266
Explanation:
Always required:
qcspecs="Yes",koshstat="Yes",microspecs="Yes",takenoff="No"

but scalecomplete is not set: scaleyesno="No"
Or: scaleyesno="Yes" AND scalecomplete="Yes"

Dacor?

0
 

Author Comment

by:schmad01
ID: 6858331
It worked after I took out the extra & next to the |. I think you overlooked that by accident.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Recent Contacts - Lotus Notes 10 645
Domino not switching to TLS 1.0 4 785
Add a cc field to email code 6 99
DIIOP IP Addresses Changes Automatically 5 84
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question