Split records in days

  date, doctrine, mysql, php, symfony

My goal is to output records to an excel sheet from dates between the 20th last month and the 20th this month.
The records are worked hours of a user.

My query to get the dates:

//get user
$user = $this->getUser();

//get hours between 20 last month and 20 this month
$hours = $this->getDoctrine()->getRepository(Hours::class)->findUserHours($user, $start20, $end20);

I get the records all at once i wondered if there is an if statement or special query to get the records day by day so i can split the records in seperate days.


enter image description here

Output of a record:

enter image description here

Source: Symfony Questions