Count specific query occurred in Redshift
IMO your query looks good. I have one idea.

Instead of:

    AND starttime BETWEEN '2017-01-24 00:00:00' AND '2017-01-25 00:00:00'


You can write:

    AND starttime::date = '2017-01-24'


The double column operator (::) converts DateTime type to Date, resulting shorter query.