Xpath expression

Hi,    I want to find the number of days between two dates and then want to compare that if the days are less than 30 using Xpath constraint so that the user with less than 30 days left can be extracted. For this i am using the expression –   [daysBetween(EndDate,'[%CurrentDateTime%]' )<=30] but this expression is showing error. So if anyone can tell me  what can be the correct expression.
2 answers

To add to Maartens answer you can achieve the same without creating an extra variable. This is especially useful if you are writing an Xpath for a data grid for example.

[EndDate < '[%EndOfCurrentDay%] + 30 * [%DayLength%]']

Hope this helps


The daysbetween function is not available on xpath, you can solve this by:

  1. Creating a datetime variable with addDays([%CurrentDateTime%],-30) or instead of currentdate time > [%BeginOfCurrentDay% depending on your functionality.
  2. Then doing an xpath retrieve with a compare, something like [EndDate >= $variable]


That way you can filter out the entity with less than 30 days in comparison to the currentdate time.