Hi,
I need to define a variable as a list of integers (eg: 2,4,7,11,15), so I can write a sql query with filter if a data field is within that list, as follows:
Select * from table1
where
field1 in variablelist
(I do not mean this the exact query, but just to give you the idea that I want to validate that the value of field1 is within those values of the list defined for the variable).
How can I do that?
Thanks,
Jose Luis
How to use a variable as a list
-
- Posts: 818
- Joined: Tue Sep 07, 2021 10:11 am
Re: How to use a variable as a list
Hello,
Please try to use the following query:
Thank you.
Please try to use the following query:
Code: Select all
SELECT * FROM Table WHERE ID IN {(var1.Count == 0 ? "(0)" : "(" + var1.ToQueryString() +")" )}
Re: How to use a variable as a list
Thanks Max, I'll try it and let you know in case of any doubt.
Beisdes that, is there any way to define a variable as a list and not to ask the user to select it?
Note: to define the list, I will need to pass the list a a parameter.
Beisdes that, is there any way to define a variable as a list and not to ask the user to select it?
Note: to define the list, I will need to pass the list a a parameter.
-
- Posts: 6365
- Joined: Tue Mar 20, 2018 5:34 am
Re: How to use a variable as a list
Hello,
Yes, you can define List variable from the code:
report.Dictionary.Variables["Variable1"] = new StiDialogInfo(...)
Thank you.
Yes, you can define List variable from the code:
report.Dictionary.Variables["Variable1"] = new StiDialogInfo(...)
Thank you.