I have a table named tsc
, with the properties ID
and DataHoraOcorrencia
. I need to query the amount of ID
and DataHoraOcorrecia
.
SQL
SELECT
DataHoraOcorrencia as DataHora,
COUNT(tsc.ID) as Quantidade
FROM tsc
WHERE DataHoraOcorrencia BETWEEN '2017-07-01' AND '2017-07-30';
My problem is in the form of DataHoraOcorrecia
, because if I make a between
with the date in aaaa-mm-dd
format, it brings me with the hours, and I only need it per day. In the case it groups by date and time and not just by date.
The DataHoraOcorrencia
ed entity is in aaaa-mm-dd hh:ii:ss
format.