I’ve tried the following formats for filtering with differing errors.
Filter: OrderHed_OrderDate gt '2017-11-1'
Error: {"HttpStatus":500,"ReasonPhrase":"REST Api Exception","ErrorMessage":"A binary operator with incompatible types was detected. Found operand types 'Edm.DateTime' and 'Edm.String' for operator kind 'GreaterThan'.","ErrorType":"Microsoft.Data.OData.ODataException"}
Filter: OrderHed_OrderDate gt 2017-11-1
Error: {"HttpStatus":500,"ReasonPhrase":"REST Api Exception","ErrorMessage":"Syntax error at position 29 in 'OrderHed_OrderDate gt 2017-11-1'.","ErrorType":"Microsoft.Data.OData.ODataException"}
Any combination I try yields one of these two errors. Any ideas?
I wonder why it works for you. I’d think it requires something like DateTime values must be delimited by single quotation marks and preceded by the word datetime, such as datetime'2010-01-25T02:13:40.1374695Z'.
{"HttpStatus":500,"ReasonPhrase":"REST Api Exception","ErrorMessage":"Unrecognized 'Edm.DateTime' literal 'datetime'2017-11-1'' at '24' in ''OrderHed_OrderDate' gt datetime'2017-11-1''.","ErrorType":"Microsoft.Data.OData.ODataException"}
Looking at the Meta Data it does show that OrderHed_OrderDate is a Date…
ok So removing the quotes from the Left Side and adding the extact format as you showed works…
So are there any rules we can find on when we need quotes on what side?
This worked! (no quote on the left)
OrderHed_OrderDate gt datetime'2017-12-01'
However this
'OrderHed_OrderDate' gt '2017-12-01'
Also works however it filters… based on string matching? Notice the quotes on the left, trying this with just the quotes on the right fails… #HeadAche