2 つの If ステートメントの条件結果をマージしたいと考えています。最初のifステートメントの結果は両方とも0の結果のみを示し、2番目のifステートメントの結果は0よりも大きくなければなりません...私がしたいのは、2番目の条件をそのままにして、ifステートメントが私のコードのように最初に変更することです...
私のコード
If (Inventory) <> 0 Then
If Apple = "" And Banana = "" Then
strSQL = strSQL & " AND (myApple = 0 AND myBanana = 0) + (myApple <> 0 OR myBanana <> 0)"
End If
End If
//初め
If (Inventory) <> 0 Then
If Apple = "" And Banana = "" Then
strSQL = strSQL & " AND (myApple = 0 AND myBanana = 0)"
End If
End If
最初の結果:
myApple myBanana
0 0
0 0
continue...
//2番
If int(Inventory) <> -1 Then
If Apple = "" And Banana = "" Then
strSQL = strSQL & " AND (myApple <> 0 OR myBanana <> 0)"
End If
End If
2番目の結果:
myApple myBanana
0 5
1 0
continue...
私が見たい結果:
myApple myBanana
0 0
0 0
0 5
1 0
6 0
0 0
continue.....