Forum Discussion

JillKauffman's avatar
JillKauffman
Qrew Member
3 months ago

Need to display hours and minutes within a TAT formula

I am using the formula below for a duration TAT.  I have checked off the HH:MM:SS for the type and it is still displaying 0:00:00 for things that are one hour from rec'd to acknowledged time entered

Days(WeekdaySub(ToDate([Acknowledgment Date/Time]),ToDate([Communication Received Date/Time])))

 

Do you have any suggestions on how to get the TAT to display accurately?

Thank you

Jill

4 Replies

  • Here is the screen shot of the field...sorry for the delay got pulled into a bunch of stuff!  If you have a suggestion would love to hear it!

    • hueyal's avatar
      hueyal
      Qrew Cadet

      I haven't tested with a vast number of scenarios; however, the formula below should be a good starting point.  Are you expecting any adjustment for 'off hours' on week days?  The formula does not account for that.  So if the received time is 5PM on day 1 and the acknowledged time is 8AM on day 2, the formula returns 15 hours.  You would get the same 15 hours if the received time is 5PM on Friday and the acknowledged time is 8AM on the following Monday.

      Formula:

      var number weekdays = (WeekdaySub(ToDate([Acknowledgment Date/Time]), ToDate([Communication Received Date/Time])));
      ToTimeOfDay([Acknowledgment Date/Time]) - ToTimeOfDay([Communication Received Date/Time]) + Hours(($weekdays)*24)

       

  • Mez's avatar
    Mez
    Qrew Captain

    Could you just subtract rec'd from ack?

    [Acknowledgment Date/Time] - [Communication Received Date/Time]

  • The reason you are getting 0 for the one hour duration between the two date/time fields is the formula converts both date/times to days.  Assuming both are on the same date, the conversion to date results in 0 days difference between the two.  Also, using Days at the beginning of the formula will return days (not hours).

    What is the data type of your formula field?  Can you share a screenshot?