Yet another DateTime difference question - InfoPath Dev
in

InfoPath Dev

Yet another DateTime difference question

Last post 11-26-2013 06:43 AM by leoffneym. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 11-07-2013 08:36 AM

    Yet another DateTime difference question

    I've been tasked with calculating the difference between two DateTime fields and I'm surprised how complicated it is.  I have found many great codeless solutions but not quite what I need... Either days or hours, but I need to know the difference in days, hours and minutes.

    StartTime
    EndTime
    Duration

    I don't care what format the duration is in... Preferably a format that makes sense... Like "# Days, # Hours, # Minutes"

  • 11-10-2013 12:58 PM In reply to

    Re: Yet another DateTime difference question

    I've not got IP or SP to hand. Yet in excel you can work out what you want as follows using the following formula which you could try to see if it would work in a calculated column.

    B2 is your End Date and Time, A2 is your start Date and Time.

    =INT(B2-A2)&" days "&TEXT(B2-A2,"h"" hrs ""m"" mins ""s""secs""")

    It assume that your original time in "A/B 2s" are in the following format: dd/mm/yyyy hh:mm:ss

    If not crack open Excel and work with the formula and others. If you can do it in excel you can normally find a similar way to do it in InfoPath if used with SharePoint.

     

     

     

  • 11-11-2013 01:41 AM In reply to

    Re: Yet another DateTime difference question

     Just checked and the above formula does work in my test environment. as a calculated column :)

  • 11-11-2013 08:03 AM In reply to

    Re: Yet another DateTime difference question

     I... really don't understand.  If I was using SharePoint I could calculate it with calculated field value, but I'm asking how to do it in InfoPath.  I don't see how I can use an Excel formula in InfoPath.

  • 11-25-2013 06:36 AM In reply to

    Re: Yet another DateTime difference question

     Anybody else have some suggestions?

  • 11-26-2013 06:43 AM In reply to

    Re: Yet another DateTime difference question

    I have attached a sample form for you.

    It calculates Days/Hours/Minutes.

    You should be able to pull what you need from it.  All of the fields are calcuated with formulas except for the Start Date and End Date.
    I left everything used to calculate the time shown.  You can preview the form and see how it works.

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