Hi,
I'm trying a simple orderby by day,month,year and it only sorts on the first orderby. Am I missing sometyhing here?
$select = db_select('recommends_rc', 'c');
// Join the Students table, so we can get the entry creator's username.
$select->join('recommends_st', 's', 'c.r_email = s.s_email');
// Select these specific fields for the output.
$select->addField('s', 'firstname');
$select->addField('s', 'lastname');
$select->addField('s', 'initial');
$select->addField('c', 'r_email');
$select->addField('c', 'r_school');
$select->addField('c', 'r_program');
$select->addField('c', 'r_status');
$select->addField('c', 'r_date_due_month');
$select->addField('c', 'r_date_due_day');
$select->addField('c', 'r_date_due_year');
$select->addField('c', 'r_timestamp');
$select->condition('c.r_status', 'Open');
$select->orderBy('c.r_date_due_day')->orderBy('c.r_date_due_month')->orderBy('c.r_date_due_year');
$entries = $select->execute()->fetchAll(PDO::FETCH_ASSOC);
//the following is the schema for the date fields.
'r_date_due_month' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => 'onth Recommendation due.',
),
'r_date_due_day' => array(
'type' => 'varchar',