How to convert seconds to hh:mm?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ddtpmyra
    Contributor
    • Jun 2008
    • 333

    How to convert seconds to hh:mm?

    Help! I have value of a field in seconds. I know is how to get the minutes by dividing it to 3600. But I wanted to display it in HH:mm.

    given number for seconds is 8111
  • ddtpmyra
    Contributor
    • Jun 2008
    • 333

    #2
    what's wrong with this?
    Code:
    AcdCallsDuration: Format(([DAgent]![AcdCallsDuration]\60) Mod 60,":00") & Format([Dagent]![AcdCallsDuration]>"Mod 60",":00")

    Comment

    • beacon
      Contributor
      • Aug 2007
      • 579

      #3
      Try this out:

      Code:
      Format([YourFieldHere]/3600, "hh:nn")

      Comment

      • ddtpmyra
        Contributor
        • Jun 2008
        • 333

        #4
        I think this will simplify my code. However how can I sum the final result?

        Code:
        Format(([YourField]/3600),"hh:nn:ss")

        Comment

        • ddtpmyra
          Contributor
          • Jun 2008
          • 333

          #5
          Im having data type mismatch error if I sum the time HH:NN.

          Comment

          • yarbrough40
            Contributor
            • Jun 2009
            • 320

            #6
            looks as though you are looking at call center data (acd). I had a similar problem displaying call duration for a call center with a .net app. Tryed to replicate the excel function [h]:mm:ss.
            here was my solution - not sure if it helps you or not.

            Comment

            • beacon
              Contributor
              • Aug 2007
              • 579

              #7
              Have you tried to sum the time(s) while still in seconds, then format it to hh:mm afterwards?

              Comment

              • ddtpmyra
                Contributor
                • Jun 2008
                • 333

                #8
                @Beacon

                I tried it but after I got 00:00:00 result value.

                Comment

                • beacon
                  Contributor
                  • Aug 2007
                  • 579

                  #9
                  Ok...how did you try it? Can you give an example of the data you're using, the function/expression you used to add the items together, and describe how you tried to convert it?

                  Comment

                  • whodgson
                    Contributor
                    • Jan 2007
                    • 542

                    #10
                    To get minutes divide seconds by 60
                    To get hours divide seconds by 3600
                    8111 /3600 = 2.253055556 ....2HH
                    .253055556*60=1 5.18mm

                    Comment

                    Working...