how To retrieve data from an entity one month back from the current day based on the changed date

0
Hi, i am trying to retrieve data from the entity one month back from the current day based on the changed date However, I am still facing the problem that the retrieved data is also older than 1 month  For example, the retrieved data should be like between today and 08/05/2023 ‘dd.mm.yyyy’ any help would be appreciated ****EDIT****** I forgot to mention that $MonthFromToday variable is  addMonths([%CurrentDateTime%], -1).
asked
2 answers
1

If you need everything between today and one month ago then something like this should work...
 

$currentObject/changedDate >= addMonths([%CurrentDateTime%], -1)


We can use the addMonths function with a negative number to go back to a previous month.

https://docs.mendix.com/refguide/add-date-function-calls/#8-addmonthsutc

answered
1

How did you create the $MonthFromToday variable? If the above is not working, it seems to me like the creation of that might be wrong.

 

$MonthFromToday

addMonths([%CurrentDateTime%], -1)

Xpath:

[ChangedDate >= $MonthFromToday and ChangedDate <= '[%CurrentDateTime%]']

 

That should do it

answered