Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi,
I need a sql select statement in a macro to query a particular value of a field. How can I do that??
Thanks..
If you mean to query value from your loaded data, not external source, then
activedocument.Evaluate()
allows to retrieve or calculate a value using QV native syntax .
sls = activedocument.Evaluate("sum(if(CustomerID=1,Sales))")
Thanks,
yes, I want to query from the loaded data. I am doing the following, but there seems to be an error. What I want to do is to query a field1 of a table, where field2 = 1
s = ActiveDocument.Evaluate("if(COLUMN_1=1,COLUMN_2)")
I think you should use some aggregation function, like only()
s = ActiveDocument.Evaluate("only(if(COLUMN_1=1,COLUMN_2))")
I suggest you debug your syntax inside a text object before using in macro. If it works in text object then it works in macro.
Thanks, it works now
Can I evaluate an expression also independently from the selections, including also the not selected values??