string SQL_Select = "select * from Time_Table where Format(T_time,'yyyy-MM-dd')>=" + "'" + StarTimePickerTime.Value.ToString("yyyy-MM-dd") + " and Format(CHECKTIME,'yyyy-MM-dd')<=" + "'" + StopTimePickerTime.Value.ToString("yyyy-MM-dd")+"'";

解决方案 »

  1.   

     SELECT * FROM your_table WHERE  between   开始时间   AND   结束时间   
      

  2.   

    把起始日期和结束日期作参数传进去,然后
    开始日期>=日期字段值 and 结束日期<=日期字段值
      

  3.   

    Declare @DateTime1 DateTime
    Declare @DateTime2 DateTime
    set @DateTime1 ='2010/12/23'
    set @DateTime1 ='2010/1/22'select * from 你的表 where 你的时间列 between @DateTime1  and @DateTime2 
      

  4.   


    select * from pr WHERE tm between '2009-8-20' AND '2009-9-11'
      

  5.   

    日期字段 between 开始日期 and 结束日期
    日期字段>开始日期 and 日期字段<结束日期
      

  6.   

    select * from Tb WHERE 字段 between @startdate and @enddate
    使用sqlparameter
      

  7.   

    select * from Tb WHERE convert(varchar,字段,120) between convert(varchar,@startdate,120) and convert(varchar,@enddate,120)