Skip to main content

Dear all,
I’m using the Odata query below, it works, however it seems all records having EMPLOYMENT_END_DATE equal to todays date are ignored due to date format.

page/Employees/List?$filter=CompanyId eq $COMPANY_ID$ and EmploymentEndDate le DayAfterMonth and EmploymentEndDate ge CurrentDate

What are supported date variables/functions I can use with Odata query?
I see DayAfterMonth, CurrentDate are working. Are there any others like Yesterday or is it possible to deduct/add number of days to the CurrentDay somehow, can I somehow truncate the date?
I did not find even DayAfterMonth, CurrentDate in the documentation.
Thanks Jan

Hi,

OData provides Date and Time Functions that can be used in $filter expressions.

To retrieve specific parts of a date, you can use functions like day(), month(), year(), hour(), minute(), and second(). For example:

$filter=day(BirthDate) eq 8
$filter=month(BirthDate) eq 5

These functions allow you to extract data such as day,month from a given date field.


You can find more information about these Date and Time Functions in the OData documentation. Odata Documentation

IFS OData Provider currently does not support certain methods, and arithmetic operations are not permitted with properties of Date, Time, or DateTimeOffset. Please consult the IFS technical documentation for more details. IFS Documentation


You are able to work with the DayAfterMonth and CurrentDate variables because they are date attributes of CompanyPerson entity of EmployeesHandling. Odata allows you to compare and perform operations involving two date attributes within your OData queries.


Hi @PathLK Is there any  support to  arithmetic operations with properties of Date, Time, or DateTimeOffset with the latest Versions of IFS such as 24R1 etc.?

 

 


Hi,

OData provides Date and Time Functions that can be used in $filter expressions.

To retrieve specific parts of a date, you can use functions like day(), month(), year(), hour(), minute(), and second(). For example:

$filter=day(BirthDate) eq 8
$filter=month(BirthDate) eq 5

These functions allow you to extract data such as day,month from a given date field.


You can find more information about these Date and Time Functions in the OData documentation. Odata Documentation

IFS OData Provider currently does not support certain methods, and arithmetic operations are not permitted with properties of Date, Time, or DateTimeOffset. Please consult the IFS technical documentation for more details. IFS Documentation


You are able to work with the DayAfterMonth and CurrentDate variables because they are date attributes of CompanyPerson entity of EmployeesHandling. Odata allows you to compare and perform operations involving two date attributes within your OData queries.

 

Hi, apologies for resurrecting this thread, but is there a way of calling sysdate at all on a lov filter ?

 

For instance, doing “ValidFrom le --today’s date--”

 

It doesn’t seem like I can call the “now()” syntax from oData filtering, is that an IFS limitation ?

 

I understand I could theoretically customize the lov to add an attribute of sysdate and then compare to that, but that’s a bit convoluted isn’t it?


Reply