Can you post the actual calculations you've defined using the ExecuteSQL function?
Do these functions return a single value or multiple values separated by a record separator?
Here is one of the working functions: ExecuteSQL ( " SELECT FLWK1_SUM FROM \"SKU DATA\" WHERE \"SKU DATA\".SKU = ? AND \"SKU DATA\".\"CHN\" = ? " ;"";"" ; SKU LIST::SKU ; "FS" )
I get an expected result of a single value. I did make an edit above while you replied. If I just reference the field and set the calculation result as text then it displays a single non-repeating value. if I set it to number, that's when I get the repeating value. If I set as text and try and do a calculation, then it gives me the repeating value again.
I have four of these fields with the above calculation and I want to get the average of all 4 results.
Another thing: The FLWK1_SUM is a summary field (SUM). I have a feeling my problem is because of that...
I'd be concerned that your summary field might not return the total you expect, but I wouldn't expect this kind of result here. The value returned by a summary field depends on the context in which it is referenced and all such "context" is missing from an SQL query.
Let me see make sure that I understand the problem fully:
You have 4 calculation fields (Stored or unstored?). I'll name them SQL1, SQL2, SQL3, SQL4.
When you use Average ( SQL1; SQL2 ; SQL3 ; SQL4 )
you get the correct result, but repeated multiple times.
Hmmm, but you indicated that the name of your function was AVG, not Average. Such a function does not exist in FileMaker. Is this a custom function or an SQL function?