Complex condition drupal query I'm trying to add following mysql condition:

WHERE       DAYOFYEAR(curdate()) &lt;= DAYOFYEAR(DATE_ADD(FROM_UNIXTIME(field_birthday_value, '%y-%m-%d'), INTERVAL (YEAR(NOW()) - YEAR(FROM_UNIXTIME(field_birthday_value, '%y-%m-%d'))) YEAR))
AND         DAYOFYEAR(curdate()) +7 &gt;= DAYOFYEAR(DATE_ADD(FROM_UNIXTIME(field_birthday_value, '%y-%m-%d'), INTERVAL (YEAR(NOW()) - YEAR(FROM_UNIXTIME(field_birthday_value, '%y-%m-%d'))) YEAR))


To my db_select $query->condition:

//Build query
$query = db_select('users', 'u');
$query-&gt;leftJoin('field_data_field_birthday', 'fb', 'u.uid = fb.entity_id');
$query-&gt;condition('THE CONDITION MUST BE ADDED HERE');
$query-&gt;fields('u', array('uid', 'name'));
$query-&gt;fields('fb', array('field_birthday_value'));
$query-&gt;range(0,5);
$users = $query-&gt;execute();


But i can't figure out how. Simple conditions like =, &lt;> are easy. But i got no clue how to add my more complex condition.

Thx

EDIT:
Should pay more attention to the documentation :). Ty! 

//Build query
$query = db_select('users', 'u');
$query-&gt;leftJoin('field_data_field_birthday', 'fb', 'u.uid = fb.entity_id');
$query-&gt;where("DAYOFYEAR(curdate()) &lt;= DAYOFYEAR(DATE_ADD(FROM_UNIXTIME(fb.field_birthday_value, '%y-%m-%d'), INTERVAL (YEAR(NOW()) - YEAR(FROM_UNIXTIME(fb.field_birthday_value, '%y-%m-%d'))) YEAR))");
$query-&gt;where("DAYOFYEAR(curdate()) +7 &gt;= DAYOFYEAR(DATE_ADD(FROM_UNIXTIME(fb.field_birthday_value, '%y-%m-%d'), INTERVAL (YEAR(NOW()) - YEAR(FROM_UNIXTIME(fb.field_birthday_value, '%y-%m-%d'))) YEAR))");
$query-&gt;fields('u', array('uid', 'name'));
$query-&gt;fields('fb', array('field_birthday_value'));
$query-&gt;range(0,5);
$users = $query-&gt;execute();
As The Docs for condition says:

Parameters
$field: The name of the field to check. If you would like to add a more complex condition involving operators or functions, use where().

So let's see QueryConditionInterface::where:

Parameters
$snippet: A portion of a WHERE clause as a prepared statement. It must use named placeholders, not ? placeholders.
$args: An associative array of arguments.

Should do the trick for you.