I need to add the detail table data the problem esque does not contain the date if not in the main table, it made it very easy in the following way: Model:
$this->db->select('COALESCE(SUM(cajas),0) as total_cajas, COALESCE(SUM(peso),0) as total_peso, COALESCE(SUM(precio),0) as total_precio');
all right up there I could correctly return the information but ALL! the problem is that I want to bring it by date try with:
$this->db->select('a.peso,a.cajas,a.precio, b.fecha');
$this->db->from('separacion_detalles a');
$this->db->join('separacion b','a.idseparacion = b.id');
$this->db->where('b.fecha',$año.$dia);
$result = $this->db->get();
return $result->row();
all good too, the problem esque where I put the sum of boxes, weight, price?