1 Reply Latest reply on May 12, 2015 7:19 AM by philmodjunk

    Need help with time calculations

    Mentor34

      Title

      Need help with time calculations

      Post

      I am creating a case log database for anesthesia providers.  I'm trying to perform time calculations such as duration of anesthesia after inputting start and end time.  Occasionally, we must pause anesthesia time.  I have pause and resume anesthesia time.  Is it possible to create a script that will account for all these variables to calculate a total time?  There would be some instances where the pause and resume are not populated (only start and end).  I'm very new to Filemaker, so detailed instructions would be greatly appreciated.

        • 1. Re: Need help with time calculations
          philmodjunk

          Might you have more than one pause? If so, you might want to set up a related table of "anesthesia intervals" with start and end times. If there are no pauses, you have one record. With one pause, you have two records. With two pauses, three and so forth. A calculation field can then compute elapsed time for each interval of anesthesia and a summary field or sum function calculation field can compute the total anesthesia time.

          But if there is never more than one pause:

          If ( Is ( Empty ( PauseTime ) ; End Time - Start Time ; End time - Resume time + Pause Time - Start Time )