Good morning, I would like to know how to count the date field (Ex: 2017-03-12 08:14:12) that is in the specified time zone (Between 08:00:00 and 08:29:00) and until 18:00:00 and 18:29:00 and I SHOW ZERO "0" when I do not find calls, but it only shows me the lines that have calls, if there are no calls I can not show zero, I thought of a LEFT JOIN but it has not worked for me, I'm looking for something like this:
| --- Hour Strip ---- | -Contact- |
| 08: 00: 00 - 08:29:00 | --- 0 ------ |
08: 30: 00 - 08:59:00 | --- 10 ----- |
| 09: 00: 00 - 09:29:00 | ---- 2 ------ |
| 09: 30: 00 - 09:59:00 | ---- 0 ------ |
| 10: 00: 00 - 10:29:00 | ---- 5 ------ |
| 10: 29: 00 - 10:59:00 | ---- 0 ------ |
...
...
| 17: 30: 00 - 17:59:00 | ---- 9 ------ |
| 18: 00: 00 - 18:29:00 | ---- 12 ---- |
Deputy UPDATED WITH CONSULTATION: link
Thanks in advance, greetings.