Skip to Content
avatar image
Former Member

How to use OData Date filter query to filter data from OData NetWeaver Gateway Service?

Hello,

I am trying to use the OData Filter query. to filter data records from the OData Service, using Date range for filters.

Please check the below URL for the SAP's sample OData Service, with filter option.

Service Query URL :

https://orderdb.herokuapp.com/orders.svc/Orders?$filter=OrderDate+ge+datetime%271996-07-04T00:00:00%27

It gives out following error :->

<message xml:lang="en">Invalid filter expression: 'OrderDate ge datetime'1996-07-04T00:00:00''</message>

Please let me know, if there is any mistake in the Query or is there anything that needs to be done on the
Backend Service.

Thanks & Regards,

Avish Kumar

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 27 at 06:09 PM

    This works for me - "<OData service>....$filter=StartDate ge datetime'2017-04-15T00:00:00' and EndDate le datetime'2017-04-28T00:00:00' " provided the entity has StartDate and EndDate as Edm.Datetime properties. Same should work for you as well.

    Add comment
    10|10000 characters needed characters exceeded