Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 4106 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi everybody,

 

i'm going to calculate a percentage with ExecuteSQL, but i believe my syntax is wrong.

 

i've 2 multiple field which show type and sale (total for type) as list, as in the picture.

 

Now i'd like to calculate a percentage on the total for each type.

 

Table are 2,

Customer where i've all customer information as name, address etc, and Type

and Invoice... 

 

for the multiple field called "Ricavi" (SALES in English) i used this:

 
ExecuteSQL("
SELECT SUM(A2.TOTAL) TOTAL
FROM CUSTOMERS A1
LEFT OUTER JOIN INVOICE A2 
ON A1.ID_CUSTOMER=A2.ID_CUSTOMER
GROUP BY A1.TYPE
";
"";""
)

 

If i write in the new calculated filed as follow it doesn't work:

 

ExecuteSQL("
SELECT SUM(A2.TOTAL) TOTAL *100 / (SELECT SUM (A2.TOTAL) From INVOICE A2)
FROM CUSTOMERS A1
LEFT OUTER JOIN INVOICE A2 
ON A1.ID_CUSTOMER=A2.ID_CUSTOMER
GROUP BY A1.TYPE
";
"";""
)

 

Who can HELP ME?

 

Thanks a lot

 

@

 

 

post-108850-0-36548500-1383393475_thumb.

This topic is 4106 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.