How to retrieve all objects of last month from 1 to last day of the month?

0
Hi guys, How do you specify to retrieve all the objects of the last month from day 1 to the last n-day of the x-month in one Xpath retrieve?
asked
2 answers
3

See the documentation here: https://world.mendix.com/display/refguide6/XPath+Keywords+and+System+Variables Example 3. In your case something like //Sales.Customer[DateRegistered > '[%BeginOfCurrentMonth%] - 1 * [%MonthLength%]' and //Sales.Customer[DateRegistered < '[%EndOfCurrentMonth%] - 1 * [%MonthLength%]

Regards,

Ronald

answered
1

I would create 2 date variables which you can use to set the begin of the specified month and the end of the specified month.

I would create the first variable with addMonths([%BeginOfCurrentMonth%], -1) and the second date variable with AddSeconds([%BeginOfCurrentMonth%], -1). Then you can retrieve all objects with something like [ObjectX/Date >= $FirstDate and ObjectX/Date <= $LastDate)

answered