Compare date not time in retrive list

0
  Actually my requirement is I want to retrive list by comparing if the two dates means user give input and current date time ,I don’t want to compare time I want to check whether use today doing any entry or not for comparing this please guide me. when I use format date time inside retrive object I got this error. What should I do Please Guide
asked
2 answers
3

So basically what you want to do, is let the user enter two dates. You'll then want to adjust those dates as follows:

  • First date that's entered should be at the start of the day (e.g. 00:00)
  • Last date that's entered should be at the end of the day (e.g. 23:59:59)

 

The start of the day should be automatically taken care of when the user enters a date (assuming you use a standard datepicker), the end of the day can be achieved by adding one day to the datetime “addDays($date, 1)” and then subtracting one second from that “addSeconds( addDays($date, 1), -1)”.

 

Now you can write an xpath where the business date is >= the startdate and <= the enddate. That should give you all objects that occur between those dates without looking at the specific time of the object.

 

Edit: screenshot

 

answered
1

Hey Akshay,

When using: '[%CurrentDateTime%]' XPath will check against current day and not the time. 
ex:
[Created_By=$CurrentUserObj/User_Name]
[Business_Date = '[%CurrentDateTime%]']

This should work for your retrieve. 


If for some reason it does not please have a look at the documentation all Xpath Constraint functions can be found here:
https://docs.mendix.com/refguide/xpath-constraint-functions

answered