Forum Discussion

DellDelemar's avatar
DellDelemar
Qrew Member
2 years ago

time duration

Good morning , 

I currently have a 

Resource Check In Date - Date field

Resource Check In Time - Time of day

Resource Check Out Date - Date

Resource Check Out Time - Time of day

Total Hrs -  Duration field ([Resource Check In Time]-[Resource Check Out Time])

Currently the results duration times are incorrect. How do i have it calculate the total hrs, and also anytime there is a checkin after midnight the results are a negative number. Also the results should roung to the nearest minute. The results are showing 8 decimal points (20.3333333333333 hours).

Hopefully someone can help me.



------------------------------
Dell Delemar
------------------------------
  • There are settings on the Formula field to control this



    ------------------------------
    Don Larson
    ------------------------------
    • MarkShnier__You's avatar
      MarkShnier__You
      Icon for Qrew Legend rankQrew Legend

      I will tag team with my buddy Don.  Don gave you the answer on that rounding issue.

      The problem with the negatives for crossing midnight can be solved by subtracting not your time fields but a date time field (or calculation).

      I will use formula variables to create a temporary field in the formula box for the date times of the check-in and checkout  

      var datetime CheckIn = ToTimeStamp([Resource Check In Date], [Resource Check In Time]);

      var datetime CheckOut = ToTimeStamp([Resource Check Out Date], [Resource Check out Time]);

      $CheckOut - $CheckIn



      ------------------------------
      Mark Shnier (Your Quickbase Coach)
      mark.shnier@gmail.com
      ------------------------------
      • DellDelemar's avatar
        DellDelemar
        Qrew Member

        Thank you that worked perfect. I will work on fixing the times that start after midnight. 



        ------------------------------
        Dell Delemar
        ------------------------------
    • DellDelemar's avatar
      DellDelemar
      Qrew Member

      Thanks i found the decimal location after this message. 



      ------------------------------
      Dell Delemar
      ------------------------------