Skip to main content
Question

Calculating Sum of Duration From Multiple Time Stamps

  • December 28, 2020
  • 0 replies
  • 189 views

Hi, 

I am recording time stamps using automation in the child table whenever there is a status update in the parent table and I need to calculate the time difference between 2 time stamps say start and stop. I was able to do it when there are only 2 time stamp but the problem is when I have more than 1 start and 1 stop. 

I need the difference between the 1st start and stop and similarly for the consecutive start and stops. There might be 20 such start and stop before a project is completed and I need the sum of the difference between each start and stop. 

Any help is appreciated. 

Thanks in advance. 



------------------------------
Srinath MR
------------------------------
This topic has been closed for replies.

Forum|alt.badge.img+15
  • Qrew Cadet
  • December 29, 2020

Srinath,

I would suggest an architecture change so that you can capture the Duration from a Child Table and then Summarize that Duration in the Parent Table.

Here is a small ERD to show what I am proposing

The [Duration] in the Child table would be a Formula Duration  [Stop]-[Start] where both are Date/Time fields.

You then use a Summary field in the Relationship between Parent and Child to add together all the Durations from the Child table.

As a work flow issue you will need to make sure that Users can only add a Child and set [Start] when the last Child record has a value for [Stop].  You can do this by creating another value in the Relationship called Max RID Child.

Here is a screen shot of the creation process

Now you know which Child record holds the most current Start and Stop.   There are a variety ways to control the Users ability to create child records and edit them.  My personal favorite is to use Formula Rich Text field where you evaluate the Child Record.  You can also set the ability to modify the records based upon the value of [Stop]

 



------------------------------
Don Larson
Paasporter
Westlake OH
------------------------------