June 1, 20214 yr Gents, I am stuck with ExecuteSQL. The problem: I have 5 shipping containers with distinct numbers. But there are 6 records in the table. I need to calculate the total weight for all 5 containers ( select distinct containers only). Thanks for your help! SQL_containers.fmp12
June 1, 20214 yr 21 minutes ago, stan111 said: I need to calculate the total weight for all 5 containers ( select distinct containers only). I am not sure I understand this requirement. Do you mean you want to summarize the sum of both weights by containerNumber - so that the result in your example would be: 111,27800 222,17800 333,26000 444,37000 555,16000 or something else?
June 1, 20214 yr Author Hi, Thanks for the reply. Please, take a look at the picture attached. Recorder Clipping (20∶48∶22).tiff
June 24, 20214 yr Hi Stan, maybe you can try first to find only the PrimaryKeys of the records you want to sum, then you can sum the containerNetWeight for those records. query_sum = "SELECT SUM(containerNetWeight) FROM SQL_containers WHERE PrimaryKey IN (SELECT max(PrimaryKey) FROM SQL_containers GROUP BY containerNumber)" regards
Create an account or sign in to comment