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

I have a query that I am trying to get to aggregate some time data, so want to do a SUM() on a Time field.  Data in the field is a duration (i.e. NOT a time of day) in MM:SS format, and I am trying to calculate how long something took to process.  (The table has a variety of records for the same parent object, representing various stages of work, so want to find out the total amount of time put in on a parent object.)

 

I am having trouble getting it to work,  just getting question marks in response.  Things work well with normal FM calculations. 

 

Here are a few of the things that I have tried:

ExecuteSQL (
    "SELECT SUM ( MovieRawTime_AsTime )
     FROM Movies
     WHERE MovieEditingDate > ? and MovieEditingDate < ?   "
; "" ; "" ; Date_Start ; Date_End )

Trying to convert it to raw # of seconds for summing, then would convert it back (that part isn't shown):

ExecuteSQL (
    "SELECT DATEDIFF ( MINUTE, '00:00:00', MovieRawTime_AsTime )
     FROM Movies
     WHERE MovieEditingDate > ? and MovieEditingDate < ?   "
; "" ; "" ; Date_Start ;Date_End )

Any suggestions would be appreciated,

-- J

Well you probably shouldn't be using a time field for something like this.

 

That being said, you may be able to convert it from one type to another. Try something like:

Let ( tt = ExecuteSQL ( "
                          SELECT SUM ( CAST ( MovieRawTime_AsTime AS INT ) )
                          FROM Movies
                          WHERE MovieEditingDate > ? and MovieEditingDate < ?
                        "
                        ; ""; ""; Date_Start; Date_End
                      );

      GetAsTime ( GetAsNumber ( tt ) )
    )

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.