input绑定的是WdatePicker
我想做的是一项查询
在Repeater中显示 数据库里date那一列里的时间是在我input1里所选的日期 至input2里我所选的之间的日期。
例如
input1 里我所选的日期为2009-01-01 input2里我所选的是2009-02-02
那么在Rpeater里要显示的就是 数据库中date列里时间等于且大于2009-01-01 并且等于且小于2009-02-02的数据信息但是我数据库里的时间是2009-4-2 0:00:00格式的。要怎么去做?
我是菜鸟具体点帮帮我。谢谢了。

解决方案 »

  1.   

    select * from tb where time between time1 and time2
      

  2.   

    select * from tb where time between to_date(time1+' 00:00:00','yyyy-mm-dd hh24:mi:ss') and to_date(time2+' 23:59:59','yyyy-mm-dd hh24:mi:ss')
      

  3.   

    .....................
    select * from tb where time between to_date(time1+' 00:00:00','yyyy-mm-dd hh24:mi:ss') and to_date(time2+' 23:59:59','yyyy-mm-dd hh24:mi:ss')
    time1=控件1的日期
    time2=控件2的日期
      

  4.   


    string startTime = dateStartTime.Value.ToString("yyyy-MM-dd") + " 0:00:00";  //开始时间
    string endTime = dateEndTime.Value.ToString("yyyy-MM-dd") + " 23:59:59";     //结束时间
    select * from tb where time between 'startTime' and 'endTime '