Function in Nested Query

Dwight

Registered User.
Local time
Today, 02:07
Joined
Mar 17, 2003
Messages
168
I wrote a custom function to calculate an average. The function uses Public variables.

Query1 has the fields required for the calculation sorted in the correct order. I call the function from Query1 and I get the correct result.

The problem occurs when I create a second query, Query2, that references Query1. When I put the calculated average field into the query grid the calculations are lost. The data reverts to its original form.

I don’t understand why this happens.
 
PHP:
. . . I create a second query, Query2, that references Query1.
is probably the problem.

References Query1 makes no technical sense.

A query can query a query. I run into very elegant and complex queries which are virtually impossible yo understand. Multiple simple queries all always considerably faster and easier for your successor to understand.
 
Thanks for the reply. I agree that simplicity is the way to go. I got it to do what I need.
 

Users who are viewing this thread

Back
Top Bottom