I'm doing the following command:
SELECT h.h_dia FROM hh h WHERE h.h_dia = 20180621 GROUP BY h.h_dia
I'm doing the following command:
SELECT h.h_dia FROM hh h WHERE h.h_dia = 20180621 GROUP BY h.h_dia
Your select should look like this:
SELECT h.h_dia FROM hh h WHERE cast(h.h_dia as date) = '2018-06-21' GROUP BY h.h_dia;
When the field is date and time, if you by in the date only filter it will understand that the time is 00:00:00 and will not return correctly, then as you only want to filter by the date, you must convert the field only for date.
If you want to filter by date and time, do the following:
SELECT h.h_dia FROM hh h WHERE h.h_dia = '2018-06-21 10:45:00' GROUP BY h.h_dia;