Task Duration - InfoPath Dev
in

InfoPath Dev

Task Duration

Last post 05-06-2016 10:05 AM by derrickss. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-05-2016 03:04 PM

    Task Duration

    I have created a form that uses the now() function to populate the begin time of a task and also added a rule to a submit button that timestamps the completion of the task using the now() function. I need to be able to determine the difference between the start time and the end time in order to start gather data on the category and types of tasks that are being completed but I can't for the life of me figure out how to get that number out of the format YYYYMMDDTHH:MM:SS. I need to make sure that I'm prepared to calculate a task that may take more than 24 hours but most will probably be under an hour and completed on the same day. With that in mind I do need the year, Month and Day along with the HH:MM:SS. I also want to continue using the now function to make the form more efficient for the individuals completing the form.
  • 05-06-2016 08:52 AM In reply to

    I've gotten far evnough that I feel like I'm learning somthing but I'm still unsure about the end result. I now have the following formula retrning something.

    (number(substring(txtEnd_Time, 12, 2)) * 3600 + number(substring(txtEnd_Time, 15, 2)) * 60 + number(substring(txtEnd_Time, 18, 2)) - (number(substring(txtDateTime, 12, 2)) * 3600 + number(substring(txtDateTime, 15, 2)) * 60)) + number(substring(txtDateTime, 18, 2)) / 3600 >= 0

    When the form is opened it displays as false which I understand for now because the End Time will not be inserted until the task is complete and the "Submit Task" button has been selected. In the preview though when I use the button and it adds the completion time the value in the difference box then changes to true which to me says that I'm getting somewhere but also doesn't allow me to check for any errors in the math. I've tried changing the "Data Type" but this desn't work.

  • 05-06-2016 10:05 AM In reply to

    I've removed the = > 0 and found that I am now returning a numerical value but can easily tell that what should have come back at 30 seconds returns 60.5 so again I'm getting closer but still unsure as to exactly what my mistake is.  I'm guesing it has something to do with converting hours and minutes into seconds.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.