I want to calculate the time difference I've tried query and query work on mysql
SELECT *, CONCAT_WS(" ", date1, hour1) AS rhour1, CONCAT_WS(" ", date2, hour2) AS rhour2, (SELECT TIMEDIFF(rhour2,rhour1) AS diffhour) from TABLE1
and I write in the active record by using codeigniter query builder:
$this->db->select('*, CONCAT_WS(" ", date1, hour1) AS rhour1, CONCAT_WS(" ", date2, hour2) AS rhour2, (SELECT TIMEDIFF(rhour2,rhour1) AS diffhour)');
$this->db->from('table1');
$this->db->join('table2','table1.code_number = table2.code_number');
$query = $this->db->get();
the result i can't get value diffhour :(
what's wrong with my code active record?