开发者

How to get count of records from the table in single table but multiple timings

开发者 https://www.devze.com 2023-02-23 05:03 出处:网络
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开发

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

精彩评论

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