我想合并我的 2 个 If 语句的条件结果。第一个 if 语句结果只显示两个 0 结果,在第二个 if 语句结果中,其中一个必须大于 0 ...我想要做的是保留第二个条件不变并首先修改 if statament 像我的代码...
我的代码
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...
//第二
If int(Inventory) <> -1 Then
If Apple = "" And Banana = "" Then
strSQL = strSQL & " AND (myApple <> 0 OR myBanana <> 0)"
End If
End If
第二个结果:
myApple myBanana
0 5
1 0
continue...
我想看到的结果:
myApple myBanana
0 0
0 0
0 5
1 0
6 0
0 0
continue.....