我想查询(*.db)表中两个时间(比如2006-6-1 到2006-6-10)之间的所有记录(表中的对应字段类型为date),这两个时间由两个DateTimePicker输入,如何实现sql查询?

解决方案 »

  1.   

    select * from Tbale where date between DateToStr(DateTimePicker1.Date) and DateToStr(DateTimePicker2.Date)
      

  2.   

    string sql="select * from table where column_name between "+DateTimePicker1.Date+"  
                and "+DateTimePicker2.Date
      

  3.   


    '''+FormatDateTime('yyyy-mm-dd',DateTimePicker2.Date)+''' 也好的!
      

  4.   

    select * from Tbale where date <=formatDateTime('YYYY-MM-DD',DateTimePicker1.Date) and date >=formatDateTime('YYYY-MM-DD',DateTimePicker2.Date)