Forum Discussion

Jay_DDS_'s avatar
Jay_DDS_
Qrew Cadet
8 years ago

Elapsed Time

I'm trying to have figure out how to calculate and elapsed time field, in minutes, how long it's been since a record was created.  

Here's the scenario:  This app will be used to check individuals in to our lobby, and track the number of visitors our receptionists are working with on a daily basis.  I'd like to calculation to be from the number of minutes since they arrived, to right now, this minute.

I'm thinking something like this, but it's not working in a Forumla-numeric field:

ToMinutes(ToTimeOfDay()-[Arrival Time])

Help?
  • so, I tired that first, and got this error:

    The expression Now() on the left hand side of the operator "-" is of type date/time while the expression [Arrival Time] on the right hand side is of type timeofday. The operator "-" cannot be used with these types of expressions.

    I'm assuming I need to make a field entitled Now, then use that field reference in place to the Now() expression?

    Just doesn't seem very clean.
  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    Formula-Duration field, with smart units, or set to minutes.

    ToTimeOfDay(Now())-[Arrival Time]

    That should give you the time between the two.
  • Thx Matthew.  I had posted an update to my response that would have been this below, but I must not have saved it correctly.


    This would be a numeric field type.

    ToMinutes(ToTimeOfDay(now())-[Arrival Time])


    .