Multiple filter conditions Azure table storage

后端 未结 5 762
半阙折子戏
半阙折子戏 2021-02-02 06:43

How can I set multiple filters on a Azure Table Storage?

This is what I\'ve tried:

string partitionFilter = TableQuery.GenerateFilterCondition(\"Partitio         


        
5条回答
  •  情话喂你
    2021-02-02 07:26

    Just wanted to add one more answer.

    string filter = "PartitionKey eq 'partition1' and Date ge datetime'31-8-2013T14:15:14Z' and Date lt datetime'31-8-2013T14:19:10Z'";
    TableQuery query = new TableQuery().Where(filter).Take(5);
    

    The reason code above is failing is because the date/time value must be entered in yyyy-MM-ddTHH:mm:ssZ format. So your query should be:

    string filter = "(PartitionKey eq 'partition1') and (Date ge datetime'2013-08-31T14:15:14Z' and Date lt datetime'2013-08-31T14:19:10Z')";
    TableQuery query = new TableQuery().Where(filter).Take(5);
    

提交回复
热议问题