API, Programming

Solved: odata filter by datetime with greater than (or less than) range

Need to filter your odata query and only have the datetime value to work with?

if your format looks like: 2018-12-31T00:00:00

Then you can query it by wrapping it in a datetime tag with quotes. see example below with it combining with an ID filter to only show a person’s information greater than 1/1/2018

https://yourserver/yourservice/YourData?$filter=(%20ID%20eq%201234%20and%20EXP_DATE%20gt%20datetime%272018-01-01T00:00:00.000%27)

Note: you can also do other options like less than (lt) or others.

Onward!