7 Replies Latest reply on Jan 29, 2013 2:00 PM by MaximilianDeCourten

    Change Minutes to Hours and Minutes?

    FarfelKnabe

      Title

      Change Minutes to Hours and Minutes?

      Post

      Hi all,

      I have a newbie question about time?

      I have two tables, each has a running time field, 15 minutes, 55 minutes and so on...

      In my main layout I have a field with a calculation that adds these two field together - presenting the result as 70 minutes.

      I would like that field to show the result in HH:MM - 01:10.

      I have tried to fidle with the scripts and the different time functions but to no success.

      /Andreas

        • 1. Re: Change Minutes to Hours and Minutes?
          philmodjunk

          If the original two fields are of type time instead of type number, then you can add your two fields together but select Time instead of number as the return type. This gives you another time field that you can put on your layout and format with HH:MM format just as you can with any other field of type time.

          • 2. Re: Change Minutes to Hours and Minutes?
            FarfelKnabe

            That's what I have done, but the result is still wrong! I enter, for an example, 55 minutes into the time field in Table1. The result in new field with the calculation change that to 55:00 - 55 hours!!!

            If I enter, for an example, 15 minutes into the time field in Table 2 - the result is just added to together - showing 70:00:00.

            Both time fields in the two tables are type time and the calculation was a text field, but I changed that to type time and changed  the input method to HH:MM - but still no success for my wish!

            /Andreas

            • 3. Re: Change Minutes to Hours and Minutes?
              ronruygrok

              like this: time(0;oldtime;0) + time(0;addedtime;0)

              oldtime and addedtime are the minutes

              • 4. Re: Change Minutes to Hours and Minutes?
                philmodjunk

                Sounds like you are entering data in the original time fields as hours rather than minutes.

                Try this calculation in your calculation field:

                (Time1 Field + Time2 Field ) / 60

                • 5. Re: Change Minutes to Hours and Minutes?
                  FarfelKnabe

                  I have now tried Phil's latest suggestion and it still want work.

                  Table1 time field is of the type Time

                  Table2 time field is of the type Time

                  Calculationfield in main layout is (the same as Table1) is the type Time.

                  I put the latest suggestion in my calculation. I enter 30 minutes in both time fields and the calculation givs 60 as a result. When I enter 30 and 31 in the time fields the calculation gives me 61 as an answer!

                  Maybe I just don't see the problem here...

                  Grateful for any help

                  /Andreas

                  • 6. Re: Change Minutes to Hours and Minutes?
                    philmodjunk

                    Here's a demo file where you have two fields of type time, the data is entered as minutes and the sum is correctly displayed as time: http://www.4shared.com/file/w9NG0TGs/TimeAdditionDemo.html

                    Let me know how it differs from yours

                    • 7. Re: Change Minutes to Hours and Minutes?
                      MaximilianDeCourten

                           I'm struggling with a similar issue here, except I have only one time field (in minutes) per record in a 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 time table the calculation field summing up the time field - but have a problem there;

                           alternatively I used a Summary field type which sort of works except giving me the same formating challenge as above: 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?