Forum Discussion

MarkComish's avatar
MarkComish
Qrew Assistant Captain
5 years ago

Split Formula Duration field into Hours and Minutes

I have a [Total Time] (Formula Duration) field.  I am using pipelines to send the data to Quick Books Online.  QBO wants the hours and minutes separated.  How can I split the [Total Time] into 2 fields [Total Hours] and [Total Minutes].

[Total Time] = 2:15

I need [Total Hours] = 2
and [Total Minutes] = 15

------------------------------
Mark Comish
------------------------------

10 Replies

  • DonLarson's avatar
    DonLarson
    Qrew Commander

    Mark,

    Congratulations on Pipeline access.  You are among a select few to have the tool set.   Please do a few posts on how it works and how easy or hard it is to work with.


    Total Hours is a Formula Numeric
    ToNumber(Left(ToText(ToHours([Total Time])),"."))

    Total Minutes is a Formula Numeric
    ToNumber("." & (Right(ToText(ToHours([Total Time])),".")))*60



    ------------------------------
    Don Larson
    Paasporter
    Westlake OH
    ------------------------------
    • MarkComish's avatar
      MarkComish
      Qrew Assistant Captain
      Thank you Don!  Worked like a charm.

      So for I have built Pipelines for Quick Books Online and Mail Chimp.  I have had great success with building from Quick Base to Mail Chimp or Quick Base to Quick Books Online.

      I have not had good success going from Quick Books Online to Quick Base or from Mail Chimp to Quick Base.  I have a support ticket in as it won't trigger in this direction.  It has been several days and no solution yet.

      On the Pipelines that work they are great.  Takes a little effort to get the hang of it but I really like them.  Right now I have the following working...

      1. Update a contact in Quick Base and then a pipeline to also update the record in Mail Chimp (something I could never get to work with Zapier.  Zapier only worked with a new record in Quick Base.

      2.  When a time log is created in Quick Base it passes this info to Quick Books Online and creates a "Time Charge"

      Still lots of pipelines I want to build once they are working in both directions better.

      ------------------------------
      Mark Comish
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Qrew Champion
        Mark. We appreciate the Pipeline info.

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------
    • DeepaPrashant1's avatar
      DeepaPrashant1
      Qrew Cadet
      Thank you Mark. I was looking for this as well. However, I need to add seconds as well and so have also created a pure StartDate and End Date and Start Time and End Time fields in Date only and Time only formats as the Date-time format does not support seconds. 

      It appears the rounding in minutes is throwing my duration off.  So if my Start Date and Time is 07-03-2020 23:02:30 and End Date and Time is 07-04-2020 06:03:05, i got my hours to calculate as 7 hours, but minutes should be 0 and seconds 35. Not getting that! 

      Can you help?


      ------------------------------
      Deepa Deepa
      ------------------------------
      • DeepaPrashant1's avatar
        DeepaPrashant1
        Qrew Cadet
        Oh! I figured it out. Just needed to clear my head :-)
        Duration (hrs) - ToNumber(Left(ToText(ToDays([10. Duration (Date/Time)])*24),"."))
        Duration (mins) - If (Minute([10. End Time])<Minute([10. Start Time]) ,Minute([10. End Time])+60-Minute([10. Start Time]),Second([10. End Time])<Second([10. Start Time]),Minute([10. End Time])-Minute([10. Start Time])-1)
        Duration (secs) - If (Second([10. End Time])<Second([10. Start Time]),(Second([10. End Time])+60)-Second([10. Start Time]),Second([10. End Time])-Second([10. Start Time]))

        ------------------------------
        Deepa Deepa
        ------------------------------