November 2, 201312 yr 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  @  Â
Create an account or sign in to comment