I am looking for a way to fetch the data for Friday (dayofweek = 6) but only between 09AM and 05PM. Is this possible and it what manner?
Ultimately from all Fridays in the past month I would like to see only data from 09AM to 5PM.
I have a simple created_on datetime column.
What I have tried and different variations of this query:
Select i.created_on from issues i
where DAYOFWEEK(i.created_on) IN (6)
and i.created_on between 'yyyy-mm-dd 09:00:00' and 'yyyy-mm-dd 17:00:00'
also
Select i.created_on from issues i
where DAYOFWEEK(i.created_on) IN (6)
and i.created_on between '09:00:00' and '17:00:00'
I get zero results, because I am missing something. If I put an exact date along with time then it works but I don't want to look for date, only time. Date would be any Friday.