Questions tagged [multiple-conditions]

Examples include if, for, while and other loops.

while (a==1 && b==2)
{
   ...
}

The loop will continue as long as a is 1 and b is 2.

630 questions
-1
votes
1 answer

sum with multiple condition in sql server

I have a query that captures the sum with multiple condition (see below), however, i would like to do the same thing but within a case statement if possible. Original Query: select sum(Total Cost) from Table where date between '7/20/2016' and…
ZYK
  • 9
  • 1
  • 1
  • 2
-1
votes
1 answer

select observations based on multiple conditions

For each subject, one observation (or row) is kept based on the following: if var2=c and var3=B then keep that observation. if not, check if var2=c and var3=S and keep that observation. if not, then then check if var2=L and var3=B, finally, check …
sri
  • 1
  • 2
-1
votes
2 answers

Jquery - multiple conditional statements for one function

I have a popup window that needs to be hidden if there was a click on my site or on the Iframe. What I would like to do is write a method like this: if(click on my site || click on Iframe){ hide window } I've tried this code but it doesn't…
Cody Cook
  • 3
  • 8
-1
votes
1 answer

All conditions for If statement met, But it is not executed

Currently In the Process of making a Chess Game, While making the Code for 'CheckMate', I got a problem where the if statement did not execute, even though all conditions were met. if (boardCopy[x][y] != null) { …
-1
votes
3 answers

How to simplify complicated if then conditions?

I have a situation where I have to exclude an ever growing list of conditions in an if statement that started out rather simple I've thought of looping an list/array and I use RegEx when possible. I would just like to know what others have done to…
mreinsmith
  • 154
  • 3
  • 14
-1
votes
1 answer

Google Spreadsheet conditional formatting for 2 columns

I am trying to have custom formula for conditional formatting, but it doesnt seem to work with the 2 conditions...: Columns TS Time Row1 Y 80 Row2 N 85 Row3 Y 60 Row4 N 4 Column 'Time' --> Should be Red if Time >= 80 and TS…
-1
votes
2 answers

If with multiple and & or

I've been trying to run the below IF condition, however it does not work as intended: If (LandscapingDataRange(MailCounter, 6) = 1 And (LandscapingDataRange(MailCounter, 4) = 0 Or LandscapingDataRange(MailCounter, 5) = 0)) _ Or…
-1
votes
2 answers

How to reduce "if statement" conditions? [reduce the conditions inside the if statement]

after days of hard thinking i choose to ask that question. I have if statement with multiple conditions: //var current is array of arrays of integers if((current[rot][0] + x)
-1
votes
1 answer

Is it possible? group by Visit.VstMobile having ( (count(Visit.VstMobile)) >1 for multiple options

Let me know if this is possible in mysql query: I have referred more options in stackoverflow. group by Visit.VstMobile having ( (count(Visit.VstMobile)>=0 and count(Visit.VstMobile)<=10) or (count(Visit.VstMobile)>=10 and…
Cruzer
  • 143
  • 1
  • 10
-1
votes
1 answer

Handling a function call nested within multiple levels of conditionals

Basically, I want to show something if multiple levels of conditions are satisfied. I'm curious about performance and maintainability of 3 different approaches. : // Approach 1 if (condition_1) { // do_stuff_1 ; if (condition_2) { //…
mnemotronic
  • 856
  • 1
  • 9
  • 16
-1
votes
4 answers

Multiple words as a possible variable in bash

The line Hi=("Hi" "Hello" "Hey") has the possible inputs. I've tried adding a comma between the words and that does not work either. If hi, hello, or hey are typed in, I need it to echo "Hi". Right now only Hi works. I guess what I'm looking for is…
Seaner992
  • 397
  • 5
  • 15
-1
votes
1 answer

How to prevent this method from calling too often while it runs

So I have a method A which basically checks to see what the current state of UISwitches are and then alerts the user via a text-SMS service API. However; since it is constantly checking the state of the pins I do not want it to send the text 50000…
Timothy Frisch
  • 2,995
  • 2
  • 30
  • 64
-1
votes
1 answer

SQL Combine two tables with two parameters

I searched forum for 1h and didn't find nothing similar. I have this problem: I want to compare two colums ID and DATE if they are the same in both tables i want to put number from table 2 next to it. But if it is not the same i want to fill yearly…
Chaler
  • 13
  • 3
-2
votes
1 answer

How to sort items in arrays meeting three conditions?

I am trying since several hours to make it work. That is why I finally decided to ask you if it is even possible to achieve this by using one single sort-method. I have an array of objects with the following type: { seats: number area:…
JackFrost
  • 83
  • 1
  • 9
-2
votes
1 answer

calling same column more than once based on different conditions error: Subquery returned more than 1 value

Projects: GUID Name 1 P1 2 P2 3 P3 Projecttasks: Name ProjectID Time PCO1 1 3600 PCA1 1 7200 PCO2 2 1000 PCA2 2 1500 PCO3 3 2000 PCA3 3 1250 Result columns: Projects.Name,…
Pale
  • 1
1 2 3
41
42