1 Reply Latest reply on Jan 29, 2013 2:30 PM by philmodjunk

    Summing up time field (in minutes) to give HH:MM result - how?

    MaximilianDeCourten

      Title

      Summing up time field (in minutes) to give HH:MM result - how?

      Post

            

           I'm struggling with a time summary issue here: I have one time field (= duration in minutes) per record in a duration table and then want to summarize the total time spent from a number of records in a different table/layout using the Portal Tool. 

           I created in the duration table the calculation field summing up the time field - but have a problem there, the sum function doesn't quite work with only one variable/field!?;

           alternatively I used a Summary field type which sort of works except giving me a formating challenge: minutes are summed up like 35 +45 = 80 instead of 1:20 - or I get the 35 minutes translated into 35x60 hrs etc.

           So: how do I sum up one time field (do I use calculations or summary) and then how do I format the result from mm to hh:mm?

        • 1. Re: Summing up time field (in minutes) to give HH:MM result - how?
          philmodjunk

               You don't appear to be summing a time field, but rather summing a number field and then having trouble getting the result to display in time format.

               

                    sum function doesn't quite work with only one variable/field!

               The sum function does work with only one field, if the field summed is from a related table such as a field in your portal.

               Sum (RelatedTable::Field ) will calculate a total of the value in field for all records in related table that link to the current layout table's record.

               This will produce the same result as your summary field, but you can multiple the result by 60 to get the number of seconds, select "time" as the return type and then data formatting can give you the HH:MM format that you've requested.

               Alternatively, you can store your elapsed minutes in a field of type time (which records time as the  number of seconds since midnight) and then your summary field can compute a total and you can use data formatting in the Inspector to format the result to display as HH:MM