atarabotto Posted November 2, 2013 Posted November 2, 2013 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  @  Â
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now