select count(sendTime)
 from GB_F_MobileSMS
Group by sendTime

解决方案 »

  1.   

    SELECT * FROM 表 where datediff(day,SendTime,日期)=0
      

  2.   

    select count(sendTime)
     from GB_F_MobileSMS
    Group by sendTime
    having datediff(mouth,SendTime,日期)=0
      

  3.   

    select 发短总数=count(*)
    from GB_F_MobileSMS
    group by convert(varchar(10),sendTime,120)
      

  4.   

    --查询2月份每天的发短总数
    declare @month varchar(2)
    set @month='2' --这里写参数,查几月写几月。select 日期=convert(varchar(10),sendTime,120),发短总数=count(*)
    from GB_F_MobileSMS
    where datepart(month,convert(varchar(10),sendTime,120))=@month
    group by convert(varchar(10),sendTime,120)
      

  5.   

    SELECT count(*) FROM 表 where datediff(day,SendTime,日期)=0
      

  6.   

    select count(*) from GB_F_MobileSMS
    group by datepart(dd,sendtime) having datepart(mm,sendtime)=?
    如求二月份的每一天的发短总数啊
    select count(*) from GB_F_MobileSMS
    group by datepart(dd,sendtime) having datepart(mm,sendtime)=2
      

  7.   

    上面的不行的话那就这样吧
    select count(*) from test where datepart(mm,sendtime)=2
    group by datepart(dd,sendtime) 
      

  8.   

    select count(*) from test where left(convert(varchar(10),sendtime,110),2)='00'
    group by datepart(dd,sendtime) 
      

  9.   

    DECLARE @Month intSet @Month=6select Count(*) AS Num,DatePart(Day,sendTime) AS Day
    from test 
    Where DatePart(Month,sendTime)=@Month
    Group BY DatePart(Month,OpeTimesendTime),DatePart(Day,sendTime)