Retrieve data based on date criteria

Hi all,   Apologies as I am fairly new with Mendix, so am learning as I go.   I’m trying to pull data with Start Dates between the filter dates that have been entered for the search, but there are multiple Start Date entries, so I need to use a Min/Max function if this is possible?   Is that possible within XPath constraint?   I’ve got this far on a Retrieve function , but it only looks at the first entry of the Start Date for each contract and doesn’t seem to work with max(StartDate) :   [StartDate>= $ReportFilter/BillingStartDate]   Let me know if this makes any sense
1 answers

Hi Lee,


I think you’ve made it quite complicated for yourself by using multiple start dates. A suggestion to solve this is to create an enitity associated with your main object called ‘StartDate’ or something like that, which has two attributes: StartDate and _Type, where Type is your type of start date, being an enumeration. In this way you have 1) more control on what start dates are present on your main object, 2) have a less complicated domain model and 3) have objects where all relevant data is filled, i.e. you don't have objects where 4 out of 6 start dates are empty, for example.


In this way you can specify in your XPath retrieve of your main object based on your start date of choice, or just from all start dates.


Hope this helps!