How to get CurrentDateTime as String in OQL statement

0
Hi team, In dataset, I am using OQL statement I want to compare a string with current date. How can I get current date as string ?   Thanks In Advance
asked
2 answers
0

Hi Ashar,

 

Please check out the following documentation:

https://docs.mendix.com/refguide/parse-and-format-date-function-calls

It allows you to format a DateTime attribute / variable in any string format.

answered
0

Current Date can be pulled as ''[%CurrentDateTime%]''

 

Below is an example where the condition is to ensure the Month of user's date of birth is same as month of current date:

 

DATEDIFF(MONTH, User.DateOfBirth, ''[%CurrentDateTime%]'') = 0

answered