on 11-20-2017 2:49 PM
Hi experts,
I have a situation in a program and we need filter a parameter with several values .
Ex:
Customer, A; B; C;
In my Action we are put the next code:
if ( !this.zztipo_cliente.IsInitial()){
selectionParams.Add(query.zztipo_cliente, "I", "EQ", this.zztipo_cliente);
}
if ( !this.zztipo_cliente1.IsInitial()){
selectionParams.Add(query.zztipo_cliente, "I", "EQ", this.zztipo_cliente1);
}
if ( !this.zztipo_cliente2.IsInitial()){
selectionParams.Add(query.zztipo_cliente, "I", "EQ", this.zztipo_cliente2);
}
if ( !this.zztipo_cliente3.IsInitial()){
selectionParams.Add(query.zztipo_cliente, "I", "EQ", this.zztipo_cliente3);
}
But with this code the query only filter with the last value.
There are some posibities of make like
selectionParams.Add(query.zztipo_cliente, "I", "EQ", this.zztipo_cliente and zztipo_clietne2; zztipo_cliente3; zztipocliente4)
Regards.
Hi Carlos,
I did not got your point exactyl, I havo a doubt that you want to use "OR" or "AND" but if you want to achieve this:
selectionParams.Add(query.zztipo_cliente, "I", "EQ", this.zztipo_cliente and zztipo_clietne2; zztipo_cliente3; zztipocliente4)
You can do like below:
selectionParams.Add(query.zztipo_cliente, "I", "EQ", this.zztipo_cliente);
selectionParams.Add(query.zztipo_cliente, "I", "EQ", this.zztipo_cliente2);
selectionParams.Add(query.zztipo_cliente, "I", "EQ", this.zztipo_cliente3);
selectionParams.Add(query.zztipo_cliente, "I", "EQ", this.zztipo_cliente4);
Var result = query.Execute(selectionParams);
This will check all conditions and exactly works as "AND"
Sin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sin,
Thank you for your answer.
Could you please give an example with the OR operation?
Thank you,
Madalin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.