Monday 30 June 2014

Infopath Date difference

Infopath get the no of days.
different b/w selected date to today.
Take Two Controls
DateRequesteddt- date time picker
NODopen- textbox, it will show different b/w selected date to today.
In Data time picker:
Add Rule
Condition 1
Today is not blank
Action
Then Set field NODopen=
0;4096
==============================
Add rules to NODopen
Rule 1
Condition 1
The expression
xdDate:AddDays(../my:DateRequesteddt, substring-before(., ";")) != ../my:Today
and
Condition 2
NODopen is contains ;
Action
Then Set field NODopen=
concat(substring-before(., ";") + substring-after(., ";") * ((translate(addDays(DateRequesteddt, substring-before(., ";")), "-", "") < translate(Today, "-", "")) * 2 - 1), ";", substring-after(., ";") / 2)
Rule 2
Condition 1
NODopen is contains ;
Action
Then Set field NODopen=
substring-before(., ";")