'Odata Contains filter with DateandTime

I am trying to query a odata service using the "contains" operator in odata filter:

*baseUri*/dataChanges?$filter=contains(typeOfChange, 'Modification') and (dateandTime ge 2022-03-08T00:00:00.00Z) and (dateandTime lt 2022-04-07T19:38:49.11Z)

Odata doesn't like this and returns a 400, it seems that the contains function is being applied to the date and time filter as well, even with the "()"

I am able to run the same query and get results back with the "equals" operator in Odata filter like this:

*baseUri*/dataChanges?$filter=typeOfChange eq 'Modification' and (dateandTime ge 2022-03-08T00:00:00.00Z and dateandTime lt 2022-04-07T19:43:54.95Z)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source