Reputation: 1056
The cosmos DB table entry manages a default Timestamp
property for each table operation. While I am trying to query last updated entries based on the same time stamp field the result is not behaving as expected. The TableQuery looks like below:
TableQuery.GenerateFilterConditionForDate("Timestamp",
QueryComparisons.GreaterThanOrEqual,
timestamp)
Where timestamp
is a DateTimeOffset
object. I am getting 0 rows retrieved even with rows existing in the table with the Timestamp
column holding a higher value. What is missing here?
Upvotes: 1
Views: 301
Reputation: 22039
Data in my table.
Query params.
Result.
var query = TableQuery.GenerateFilterConditionForDate("Timestamp", QueryComparisons.GreaterThanOrEqual, DateTimeOffset.Now.AddDays(-10).Date);
var exQuery = new TableQuery<CustomerEntity>().Where(query);
var results0 = sourcetable.ExecuteQuery(exQuery).ToList();
//var results1 = sourcetable.ExecuteQuery(exQuery).Select(ent => (CustomerEntity)ent).ToList();
Upvotes: 1