2个textbox控件分别填入起始日期,终止日期。实现这段时间内表内容的查询该怎么写?
SELECT*FROM [BookInfo]WHERE([date]????
劳驾各位大神

解决方案 »

  1.   

    select * from table where date>=begintime and date<=endtime
      

  2.   

    select * from table where date between begintime and endtime
      

  3.   

     between and 处理,如果对时间要求比较宽泛,比如天之间的间隔,建议用int型处理,例如20130322,这样比较筛选来的快的多
      

  4.   

    不好意思新手能详细写写 控件textbox1(用来填入起始日期的)textbox2(用来填入终止日期的)button1(用来按钮来查询gridview中选中这段时间内的内容)SELECT*FROM [BookInfo]WHERE([date]between???and???
      

  5.   

    不好意思新手能详细写写 控件textbox1(用来填入起始日期的)textbox2(用来填入终止日期的)button1(用来按钮来查询gridview中选中这段时间内的内容)SELECT*FROM [BookInfo]WHERE([date]between???and???
      

  6.   

    select * from table where date>=begintime and date<=endtime 
      

  7.   

    上面的写法都是不正确的
    尤其在 endtime 上,默认情况下 endtime 只到 0时0分0秒
    最好是 date >= begintime and date < (endtime + 1天)
    N久不写代码了,具体函数是哪个,自己找找吧