I want to validate the entries and exits of a number of people in the day, that is, count how many people have entered, how many have left. for this I have a field called fecha_entrada
and fecha_salida
(both fields are datetime), the idea as I mentioned is to validate how many have entered and left in the day but I specifically need the date (Ymd) without setting the time:
CODE:
$cant_peoples =
$this->db->select('count(*) as in_company')
->from('company')
->where('entry_date', date('Y-m-d'))
->where('entry_date !=', '' )
->get()
->row();
The problem is that this internally throws a 0, and I do not know if it is because it is not possible to validate a date with datetime