Forum Discussion

MikeTamoush's avatar
MikeTamoush
Qrew Commander
2 years ago

Max Time in Child Records

Anyone have a work around to get the Max time from a child record? Maximum Summary field does not work on times, only numbers and dates.

There must be a work around I am not thinking of? Maybe convert the time to a 24 hour clock, and then to a number? Then max the number and convert back?

------------------------------
Mike Tamoush
------------------------------

3 Replies

  • MarkShnier__You's avatar
    MarkShnier__You
    Qrew #1 Challenger
    You can make a Duration field 

    [my time of day field] - ToTimeOf Day("12:00 am")

    I'm assuming that you can do a summary Maximum on that. Then if you need to convert that back to a time of day field you could make a new field 

    ToTimestamp(Today(), ToTimeOfDay("12:00 am")) + [My summary Max duration field]

    - ToTimestamp(Today(), ToTimeOfDay("12:00 am"))

    I don't think you are allowed to add duration to a time of day field.  It's a vague memory but I did not have time to test.

    .

    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------
  • DonLarson's avatar
    DonLarson
    Qrew Commander
    Mike,

    I tested @Mark Shnier (Your Quickbase Coach)'s suggestion.

    Here is my Child Table Data



    Then my Parent Record sees this

    So then the last step is to convert the Duration back into Time on the Parent Record with a second Formula field. 

    Good suggestion by Mark as always.  I will have to remember this for the future.



    ------------------------------
    Don Larson
    ------------------------------
    • MikeTamoush's avatar
      MikeTamoush
      Qrew Commander
      Also confirming this worked great. Additionally, to change back to Time, I just needed a snip of Marks code:

      ToTimeOfDay("12:00 am")) + [My summary Max duration field]

      ------------------------------
      Mike Tamoush
      ------------------------------