Hello Nirosha N,
What you can do this is create some logic with a variable with a cutoffdateofbirth, this variable you can define by the following:
addYears([%CurrentDateTime%]
, -18)
more about this function here
https://docs.mendix.com/refguide/add-date-function-calls/
After you calculate this cutoff date you can retrieve the employees based on a xpath:
dateofbirth > cutofdateofbirth
Then you will get a list of all the employees that are younger than 18 and you can loop over this list to clean up the data
Hope this helps,
Good luck!
Hi Nirosha,
Maybe you Can use
calendarYearsBetween()
function, and calculate the years between the DOB and current date and then use it to check if it is bigger than 18 or not.
calendarYearsBetween(DOB,[%CurrentDateTime%])
This will return you the number of years.
You can read more about this using this URL
Let me know, if you have any issues,
Hope it helps!
Rishabh
(Resilient It Services)
Check my flow is correct for delete the employee record if emp_age < 18 ?
Note: here I'm not going to delete the record instead I'm just changing the attribute of is_delete = true.
I have one query I have two Attributes DOB(Date and Time) and Age(Integer)
then How you'll calculate the age for integer data type?