Reputation: 5694
I have a date field in the form created using InfoPath, that allows the users to enter a date, which presumably is the due date of a task. And I want to have another "calculated value" field to:
Is this possible without writing VB/C# code, but just pasting an expression into the XPath dialog box?
Thanks!
Upvotes: 0
Views: 8780
Reputation: 2436
Assuming this is your xml node where user enters date value
<due-date>2012-02-08</due-date>
then below xpath expression will return the days remaining for the due-date if the date entered is before the current-date and returns 'OverDue' if the entered date passes current-date.
if((xs:date(current-date())) <= (xs:date(/due-date)))
then days-from-duration( (xs:date(/due-date)) - (xs:date(current-date())) )
else 'OverDue'
Upvotes: 3