select day(dd,DATETIME),count(*) from (select distinct * from logs_currentmonth)a
group by day(dd,DATETIME)
Because there is data for some other month that has a 28th. I would recommend:
select cast([datetime] as date), count(*) from (select distinct cm.* from logs_currentmonth cm ) cm where [datetime] >= '2016-10-01' group by cast([datetime] as date) order by cast([datetime] as date);
If you don't need the
select distinct, then don't use it! It just slows down the query.