I am trying to calculate the difference between two date picker fields which should result the value in number of days in infopath.

I tried number(substring(field1, 9, 2)) - number(substring(field2, 9, 2)) but it calculates on the different in dates and does not consider month. If the field one is 5th May 2020 and field 2 is 6th Jun 2020, it still gives the difference as 1.

Can anyone help by suggesting how can this be achieved?

Thank you.

  • 1
    Check this if it helps you. May 14 '20 at 13:02
  • Thank you, Ganesh. It helped! :)
    – HRY
    May 17 '20 at 10:41
  • Great, I am glad it helped you. I am writing it as an answer below. Please Upvote and accept it as an answer as it helped you. May 17 '20 at 11:40

There are two possible solutions to your problem :

  1. Using qrules(not free)

  2. Use rules, conditions, and the number(), floor(), and substring() functions in formulas to calculate the difference between two date picker controls in InfoPath.

You can read more about it in below question on forum:

Help please-Solve: Number of days = (todays date - date initiated)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.