开发者

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)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜