db_select returns empty array, BUT the raw query returns records...? I've written a query to get records that start column is later than a given time. Take the following:

$q = db_select('timetable_slot', 's')
    -&gt;fields('s')
    -&gt;where('str_to_date(s.start, \'%H:%i\') &gt;= \'15:24\' ');

    print_r($q-&gt;__toString());
    /* SELECT s.* FROM timetable_slot s WHERE (str_to_date(s.start, '%H:%i') &gt;= '15:24' ) */


$result = $q-&gt;execute()
    -&gt;fetchAll();

print_r($result); /* [] */


$result comes back as an empty array.
If I run the generated SQL manually I get the results I expect, any reason why drupal is returning an empty set?

I've also tried:

db_query("SELECT s.* FROM {timetable_slot} s WHERE (str_to_date(s.start, '%H:%i') &gt; '15:24')")-&gt;fetchAll(); 


This also returns empty, even though the query works in a db client.

Thanks
It's impossible to troubleshoot such a query without access to your environment.

The Devel module has a query inspection tool (Display query log in the Devel settings). that can assist you in determining what query was sent to your database. Use that to determine the exact query sent to your DB and  how it differs from the query you're sending to your SQL client.