1 Reply Latest reply: May 15, 2014 9:54 AM by Grant Perkins RSS

    Summarizing Mins

    Lance Wheeler

      How can I summarize by day the minutes worked when I have a table w/ Date & Time In and Date & Time Out that crosses dates?


      Thanks, Lance

        • Summarizing Mins
          Grant Perkins

          Hi Lance,


          I see you have a recent version of Monarch so have a look at the AGE() function. It allows you to calculate the difference between two dates and times and return the result in units as small as seconds.


          If your report crosses two dates then you need to split the calculation to compare to an end of day time and a start of day time (watch for the odd excess minutes due to overlap of dates/times chosen!).


          Alternatively calculate the number of minutes in the entire time span, then calculate one of the days portions and obtain the second value by subtraction of the first day value from the total.


          If your date/time range covers more than 2 dates then obviously you need to compensate accordingly. If total minutes are greater than 1440 there is a possibility that more than 2 days are involved. If you get more than 2880 it is a certainty! Of course there are a few other way to assess that with a number of functions in the functions catalogue that you could use.