Azure Storage TableQuery Where Clause with node.js

I'm constructing and executing the following query:

var queryDate = new Date(2013, 6, 22);
var query = azure.TableQuery
                 .select()
                 .from("WADLogsTable")
                 .where("Timestamp > ?", queryDate);

 tableService.queryEntities(query, function(err, entities){
     ......
 });

However entities is returning as empty, if I remove the where clause then the entities collection is populated?

Any thoughts on what is wrong with this query?

If I dump out the query object to the console it looks like - { _fields: [], _from: 'WADLogsTable', _where: [ 'Timestamp gt datetime\'2013-07-21T23:00:00.000Z\'' ], _top: null, _partitionKey: null, _nextPartitionKey: null, _rowKey: null, _nextRowKey: null }

Since your query does not include PartitionKey, your query is causing full table scan. For each query request to table service, it can return a maximum of 1000 matching entities. If no match is found and more entities are available, table service returns a continuation token which should be used to fetch next set of entities. So what's happening in your case is that the table service starts from top (1st Partition) and tries to find entities matching your query criteria. Since it does not find anything, it returns no value. However if you check the response headers, you should see headers like x-ms-continuation-NextPartitionKey and x-ms-continuation-NextRowKey.

For best performance, your query should always include PartitionKey. Do take a look at this blog post on effectively fetching diagnostics data I wrote sometime ago: http://gauravmantri.com/2012/02/17/effective-way-of-fetching-diagnostics-data-from-windows-azure-diagnostics-table-hint-use-partitionkey/.