title: Cassandra SELECT BETWEEN two dates
body: <p>How can i convert below SQL query to CQL query?</p>
  
  <pre><code>SELECT * FROM csv_report WHERE sensor_id=170268 AND create_day BETWEEN 20150401 AND 20150403;
  </code></pre>
  
  <p>also i trying different BETWEEN query:</p>
  
  <pre><code>SELECT * FROM csv_report WHERE sensor_id=170268 AND create_day &gt;= 20150401 AND create_day &lt;= 20150403;
  </code></pre>
  
  <p>But this query raised an error:</p>
  
  <blockquote>
    <p>code=2200 [Invalid query] message="Only EQ and IN relation are supported on the partition key (unless you use the token() function)"</p>
  </blockquote>