Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Filter Out Records with Null DateTime Values in a GET Request for OData Service

kakshat
Advisor
Advisor

Hello,

I am making a GET request on an OData service to get entities which have, among other fields, a DateTime (YYYY-MM-DDTHH:MM:SS) type of field. This field is filterable. I want to filter out those entities for which this DateTime field is null.

How should the URI be framed so that this can be achieved?

I have already tried the following but to no avail:

1. Checking for equality with 0000-00-00T00:00:00 - It does not help as the system apparently considers a null value different from an initial value (such as above).

2. Adding the dual condition "DateTime > 0000-00-00T00:00:00" and "DateTime < 9999-12-31T00:00:00"

Thanks,
Akshat

  • SAP Managed Tags:
1 REPLY 1

kakshat
Advisor
Advisor

While I was doing a hit-and-trial, I found that I was able to filter out the blank values by using the condition gt datetime'0001-00-00T00:00:00'.

  • SAP Managed Tags: