select CAST(TimeCompleted_BaseDateTimeUTC as date) as [DAY], 
COUNT(ID) 
from ProductRouteTransactions 
WHERE CAST(TimeCompleted_BaseDateTimeUTC as date) >=dateadd(day,datediff(day,0,GetDate())- 30,0) 
GROUP BY CAST(TimeCompleted_BaseDateTimeUTC as date) 
 
order by CAST(TimeCompleted_BaseDateTimeUTC as date)
