How to get count of records from the table in single table but multiple timings
my requirement is I want to take count of records from that table on particular date..but createddate column haveving datetime..when I try to count the records it giving multiple records on same da开发者_JS百科te because time is different. How to take count of records on particular day...even time is different?
try this
select count(*),DATEADD(DD, DATEDIFF(DD,0,DateColumn), 0)
from SOmeTAble
group by DATEADD(DD, DATEDIFF(DD,0,DateColumn), 0)
example
select count(*),DATEADD(DD, DATEDIFF(DD,0,crdate ), 0)
from sysobjects
group by DATEADD(DD, DATEDIFF(DD,0,crdate ), 0)
精彩评论