Easy: Time Question

I want to calculate the time that a document is in a certain status(In Progress). I have a start button on my form that starts the ticket and puts it in progress and then a finsh button that changes it to close. Simple right. Close minus start. Well what is they click start and change the status to something else. (Researching, pending…) and when they go back into that doc it changes it to inprogress. I want a total of min of how long this document is in progress.

Subject: Easy: Time Question

It is easy (or at least conceptually straightforward). You’ll have to keep track of the multiple start and stop times (assuming that the other status’, researching, pending, etc.) don’t count as “in progress”. One way would be to keep a list of dates (a single field allowing multiple, or a list of date/time values). Your list would consist of date/time stamps into and out of the in progress status - i. e., record a date/time each time the status changes. Your calculator could then walk the list and count up the time2 - time1 plus time4 - time3, etc. If there is an uneven pairing, you would assume that the current in progress has not been closed.

Another way, would be to accumulate the in progress time each time you leave the state.

The first way does less work on state changes but, relies on reliable recording of the date/time list. You also need calculate the time when you need it (views, reports, etc.).

The second way does a bit more work on each state change (calculating the accumulated in progress time) but, the accumulation is then always current in the document and available for use elsewhere without calculation.

Subject: RE: Easy: Time Question

I think your second option is much more efficient Dieter.

calculating each time and keeping a running total so that anytime you will see the latest version of the total