We want to date filter criteria for the getting all data of the day or today. We are trying code as below but we are getting error. Please provide need full solution.
$filter=ServiceCallID eq 425977 and DateCreated eq '11/28/2016 12:45:25 PM'
I believe you need to define the parameter as a
DateTime. You get the error because .NET interprets your parameter as a
string, but the type is
datetime'yyyy-mm-ddThh:mm[:ss[.fffffff]]' NOTE: Spaces are not allowed between datetime and quoted portion. datetime is case-insensitive
$filter=ServiceCallID eq 425977 and DateCreated eq datetime'2016-11-18T12:45:25'
Note that I also changed the format to
YYYY-MM-dd. You may also want to change
lt, depending on your definition of today.
So your final solution may be
greater or equal to 2016-11-18. And
less than 2016-11-19. It should give all items during 2016-11-18.
$filter=ServiceCallID eq 425977 and DateCreated ge datetime'2016-11-18' and DateCreated lt datetime'2016-11-19'