I'm trying to get a set of results with timestamp within a given date range from a CosmosDb using the Table API.
This is how I'm constructing my query:
var from = TableQuery.GenerateFilterConditionForDate("Timestamp", QueryComparisons.GreaterThanOrEqual,
new DateTimeOffset(2018, 2, 15, 15, 2, 45, TimeSpan.Zero));
var to = TableQuery.GenerateFilterConditionForDate("Timestamp", QueryComparisons.LessThan,
new DateTimeOffset(2018, 2, 15, 15, 3, 45, TimeSpan.Zero));
return new TableQuery<Audit>()
.Where(
TableQuery.CombineFilters(from, TableOperators.And, to));
However, when I run this query I get the following exception of type InvalidFilterException
:
ODataException: Unrecognized 'Edm.String' literal 'datetime'2018-02-15T15:02:45.0000000Z'' at '14' in '(Timestamp ge datetime'2018-02-15T15:02:45.0000000Z') and (Timestamp ge datetime'2018-02-15T15:03:45.0000000Z')'.
Can anyone help me understand what this means? Am I doing something wrong?