addHours in Xpath retrieve

0
Is there an equivalent way to use addHours in xpath for a retrieve from the database?   I am trying to retrieve all Appointment objects with a ‘Start’ of between 24 and 28 hours in the future.
asked
3 answers
3

You can create 2 DateTime variables with the addhours before the retrieve. Then use the variables in your xpath.

answered
3

For completeness, this can be done purely in XPath without using extra variables. This is especially good to know if the XPath is in the context of a page where variables can not be used.

[Start >= '[%CurrentDateTime%] + 24 * [%HourLength%]' and
 Start <= '[%CurrentDateTime%] + 28 * [%HourLength%]']
[Active]
[ReminderSend = empty]

For performance reasons, it is best to use the most constraining expression first.

answered
0

As per Maarten’s answer, perfect, thank you.

answered