Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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

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? 

  • Author

Any ideas, gentlemen?

 

  • 3 weeks later...

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.