I'm looking into the new ASP.NET Web API as a reporting tool.
In SQL I would do this:
WHERE order_date
BETWEEN to_date ('2003/01/01', 'yyyy/mm/dd')
AND to_date ('2003/12/31', 'yyyy/mm/dd');
...how do these type of command translate in the ODATA protocol URL?
With the Visual Studio 2012.2 update, OData support is back and the following url works for filtering dates:
http://host/api/controller?$filter=order_date+gt+datetime'2003-01-01'+and+order_date+lt+datetime'2003-12-31'
If you want to include a time, you should specify the dates in ISO 8601 format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With