title: Compare two dates in unix timestamps in mysql
body: <p>The query works perfectly with greater than.</p>
  
  <pre><code>select RunId,count(ObjectId) 
  From Run  
  WHERE Created_On &gt;= UNIX_TIMESTAMP('2015-01-12')  
  group by RunId
  </code></pre>
  
  <p>But I want to compare the timestamps between two dates and when I tried the queries with less than its not fetching any rows.</p>
  
  <pre><code>select RunId,count(ObjectId) 
  From Run 
  WHERE Created_On &lt;= UNIX_TIMESTAMP('2017-01-12')  
  group by RunId
  
  select RunId,count(ObjectId) 
  From Run 
  WHERE Created_On &gt;= UNIX_TIMESTAMP('2015-01-12') and Created_On &lt; UNIX_TIMESTAMP('2017-01-12') 
  group by RunId
  </code></pre>