Correct way for a db_query for nodes between two timestamps
You can try using db_select instead wich is a better way to create query with Drupal (assuming you are using Drupal 7).

$start_time = '1403564400';
$end_time = '1403650800';
$query = db_select('node', 'n')
  -&gt;fields('n', array('nid', 'created', 'title'))
  -&gt;condition('created', array($start_time, $end_time), 'BETWEEN');
$result = $query-&gt;execute();
$record = $result-&gt;fetchAll();