Using the date of a result column as a partial input
Throw more detail and more sample data.

you cannot pull all the data.you have to pull data of some specific date which you pass as parameter.

here consider @DateTable  is parameter.or you pass detail what you want


you can try some thing like this,

declare @DateTable table(ReportDate datetime)
insert into @DateTable values('2017-06-02'),('2017-06-03')

create table #t (colTime datetime)
insert into #t 
select  dateadd(hour,number,ReportDate)  from @DateTable
cross apply(select distinct number  from master..spt_values where number&gt;0 and number&lt;25
)ca

--select * from #t

--analyze this
--select *
--from #t t
--left join table1 v
--on t.colTime=dateadd(hour, datediff(hour, 0, v.ModifiedDate), 0) 


select t.colTime  
,count(id)
from #t t
left join table1 v
on t.colTime=dateadd(hour, datediff(hour, 0, v.ModifiedDate), 0) 
group by t.colTime

drop table #t