RT

解决方案 »

  1.   

    select count(1) from tb where datediff(dd,dt,getdate()) = 0
      

  2.   

    不是当天啊,是指定日期,前台用日历控件选取的
    dateTime happen 数据库里的字段是happendate
    我有两种方法:
    一个是
    "select count(*) from tablename where Convert(varchar(10),[happendate],120)=" + happen.ToString("yyyy-MM-dd")
    另一个是
    "select count(*) from tablename where Convert(varchar(10),[happendate],120)=" + happen.toShortDateString()
      

  3.   

    where  datepart(dd,字段)=指定的那天