title: DynamoDb Query using Between operator on Primary(Partition) Key only
body: <p>I have a Dynamo table in which I have partition key only - &quot;CreatedAt&quot; and some other attributes.</p>
  <p>I want to write a Query in which I will get no. of items where CreatedAt is between LastSunday and Today.</p>
  <p>I have stored the date in string format as &quot;2021-03-09T14:33:29Z&quot;.</p>
  <p>I do not want to use GSI's.</p>
  <p>with below query I get an error - <em>&quot;Query key condition not supported&quot;</em></p>
  <p>Here is my code :</p>
  <pre><code> var queryRequest = new QueryRequest
              {
                  TableName = myTableName,
                  KeyConditionExpression = &quot;CreatedAt BETWEEN :LastMonday AND :TodaysDate&quot;,
              };
              Dictionary&lt;string, AttributeValue&gt; expressionAttributeValues = new Dictionary&lt;string, AttributeValue&gt;();
              expressionAttributeValues.Add(&quot;:TodaysDate&quot;, new AttributeValue { S = &quot;2021-03-09T14:33:29Z&quot; });
              expressionAttributeValues.Add(&quot;:LastMonday&quot;, new AttributeValue { S = &quot;2021-03-02T14:33:29Z&quot; });
              queryRequest.ExpressionAttributeValues = expressionAttributeValues;
              var response = await awsDynamoClient.QueryAsync(queryRequest); 
  </code></pre>