Hi
I currently have a problem that is driving me insane!!
I am trying to make a text field show the difference between 2 date picker fields. I have found a great website with all the rules written out and also a demo form to download with the whole solution working.
I have replicated the exact data field types and there label names into my form, and then copied exactly the same rules and conditions to the fields created in my form,
However I cannot get the 1st rule on the dateDifference field to work it produces the same error every time when testing the formula and being a relative nove at InfoPath I cannot understand what is going wrong.
The rule and formula on the field is as follows:
Rule 1
Condition
The Expression xdDate:AddDays(../my:startDate, substring-before(., ";")) != ../my:endDate
And
Day difference contains ";"
Rule
Set Fields Value - DayDifference -
concat(substring-before(., ";") + substring-after(., ";") * ((translate(addDays(startDate, substring-before(., ";")), "-", "") < translate(endDate, "-", "")) * 2 - 1), ";", substring-after(., ";") / 2)
The error message I am getting when I click Verify Formula is Function 'AddDays' did not return a value, or it returned a value that cannot be converted to an XSL data type.
Any help with this would be much appreciated.
Thanks in Advance
Geoff