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.

summing a time field across records

Featured Replies

Apologies for what is a basic question, but I'm trying to sum one time field across a set of related records (e.g., all children of a a related parent record) and have tried various calcs and summaries, etc. but have come up short. I've read the FM help and have looked through my 3rd party books as well. If nothing else, could someone tell me if I need to convert the data in the time fields (hours, minutes, seconds) to numbers first, and then convert back to a time format for the summary? Thank you.

Ken

Edited by Guest

No conversion is required. Define a calculation field in the parent table (result is Time) =

Sum ( Child::Timefield )

  • Author

Thanks, Veteran. Turns out I had it right, but... the time field I created for the children had a HH:MM format, and the sum field in the parent a HH:MM:SS format. So I was entering 2:03, thinking that was two minutes three seconds, but it was hours. I thought the value in the sum field was summing all the records (not just the related children). Got that sorted out now.

Users of this system will almost always enter values of minutes and seconds; occasionally seconds only, and *very* rarely any hours (excluding "0" of course). I wonder what a good interface would be; perhaps create number fields for hours, minutes, and seconds, then the user enters what s/he needs (e.g., for 2 min. 3 sec., enter nothing in the hour field, "2" in the minutes field, "3" in the seconds field, then some mechanism to set an actual time field. This way they'd have to enter no leading zeros or a time separator ( ":" ).

Ken

I would use a text field for the entry and the period as the separator. Then the timefield can be a calculation (or auto-entry) of something like:

Substitute ( Right ( "00.00.00" & TextEntry ; 8 ) ; "." ; ":" )

(If you'd always enter only mm.ss, you could enter directly into the time field, and use an auto-enter to substitute a colon for the period. Unfortunately, it seems this won't work when the entry contains 2 periods.)

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.