I am getting nowhere trying to set up an arraybuild to retrieve the data I want here. No matter how many times I read the documentation, I can't discern the requirements of the 4th and 5th parameters, i.e., the "formula" and the "query". The description does not make it clear to me what should be in those parameters. I can get it to run without error, but it isn't returning anything, let alone what I'm after. Maybe someone can straighten me out.
Here is the description of how the statement is to be formed:
arraybuild ARRAY, SEPARATOR, DATABASE, FORMULA, QUERY
The first 3 are easy: ARRAY is a local variable AdjArray I have declared, SEPARATOR is ";", DATABASE is current, so "".
I want to retrieve the contents of field «Adjusted Total» (numeric) in the database, and the query I have set up for the Text List is exactly appropriate for this data. This query is contained in a local variable MyQuery, whose contents are thus:
"monthvalue(«PayDate») = "+val(mymo)+ " and yearvalue(«PayDate») = "+val(myyr)+" AND «Invoice No.» > 0 and State = 'WA'"
variable mymo and myyr are set up earlier in the procedure. In the Text List it gets me exactly what I want. So I have constructed my statement like this:
ArrayBuild AdjArray,";","","Adjusted Total",MyQuery
Whether I put quotes or chevrons around Adjusted Total it makes no difference. I have put the query in literally instead of as a variable, no difference.
I just don't understand, and maybe because it's Friday approaching a beautiful weekend here. Help is appreciated.