We hope you'll join us for our 4/23 webinar on using data tables to apply reference ranges and AE codes in OC4. For more information and to register, visit https://register.gotowebinar.com/register/2882170018956684555

Rules to calculate the number of minutes between two timefields

Hi All,

I know we can use a regular expression to compare times (http://www.trialdatasolutions.com/tds/howto/usingregexpfortimefield.jsp) and we can use javascript to calculate the number of minutes between two timefields (http://www.trialdatasolutions.com/tds/howto/timediff.jsp). 
But can we use a regular expression to calculare the number of minutes?? Maybe it is so easy... but I can't see how I can manage that! If someone can help me, I will be very grateful!!!

Thanks!
Marina

Comments

  • lindsay.stevenslindsay.stevens Posts: 404 ✭✭✭
    via Email
    The regular expression shown is a type of item validation, which checks
    that a float value looks like a time.

    The built-in calculations can add items but since the time is a float, so
    you might have weird stuff like 10:90AM.

    JavaScript has the tools needed to deal with this problem. The example
    places the calculated value in a field so you can write a rule to check
    whether it is within some expected range.

    It might be possible to instead post some discrepancy note data to create a
    query directly, if the item value doesn't need to be saved.
This discussion has been closed.