Converting time data - InfoPath Dev
in

InfoPath Dev

Converting time data

Last post 02-02-2012 01:55 PM by Drewski. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-31-2012 09:14 AM

    Converting time data

    I ran into an issue today trying to convert and average time data in a repeating table. In SharePoint I have some fields that are tracking time metrics on how long a workflow takes so when you subtract two date fields with time enabled you get an answer like 1.003020833. Within SharePoint I was able to convert this time into a more readable time using this equation: =CONCATENATE(TEXT(INT([Field]),"00"),".",TEXT(INT(MOD([Field],1)*24),"00"),":",TEXT(MOD(MOD([Field],1)*1440,60),"00")) So an answer like 1.003020833 would be converted to 01.00:04 telling me that the workflow took 1 day and 4 minutes to complete. Within InfoPath most of these functions are not available so I was not able to use this same equation. I want to average all of the entries within the SharePoint library and convert the answer to something like what I have displayed above. Thanks in advance!
  • 01-31-2012 11:16 AM In reply to

    Most of these functions are available in InfoPath, just in slightly different manifestations:

    CONCATENATE(a, b, c) -> concat(a, b, c)

    INT(a) -> floor(a)

    MOD(a, b) -> a mod b

    Zero padding is a bit trickier, but this should work for zero-padding a number to 2 digits:

    substring(a + 100, 2, 2)

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-02-2012 01:55 PM In reply to

    Thanks Jimmy that did the trick

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.