I have the following query and I want to store in two variables fields ‘dtFromDate’ and ‘dtToDate’ in order to use them in other methods. As it is now the code, they return null when I use them. How should I do this?
Your current code doesn’t ever set any value to those variables, so they will be always empty.
You can get values either from parameters, or from internal state of an object. In the latter case, you need to move your code to a class and turn the variables to instance ones (i.e. declared in ClassDeclaration). Then you have to set the values somewhere. If you want to use parameters, move the code to a table method or a class method, turn the variables to parameters and call the method with required values.